Tuesday, June 29, 2010

javax.transaction.xa.XAException

Issue:

javax.transaction.xa.XAException: com.microsoft.sqlserver.jdbc.SQLServerException: Failed to create the XA control connection. Error: "Could not find stored procedure 'master..xp_sqljdbc_xa_init_ex'."

Resolution:

1. Ensure Microsoft Distributed Transaction Coordinator is installed and running on every SQL Server machine that will participate in distributed transactions.

a. From Control Panel, open Administrative Tools, and then open Component Services. You can also click the Start button, click Run, type dcomcnfg in the Open box, and then press OK to open Component Services.

b. Expand Component Services, Computers and right-click My Computer, and then select Properties.

c. Click the MSDTC tab, and then click Security Configuration.

d. Select the Enable XA Transactions check box, and then click OK. This will cause a MS DTC service restart.

e. Click OK again to close the Properties dialog box, and then close Component Services.

f. Stop and then restart SQL Server to ensure that it syncs up with the MS DTC changes

2. Install the Microsoft SQL Server JDBC driver 2.0 from the url in the reference section.

3. Copy the sqljdbc_xa.dll from this directory to the Binn directory of every SQL Server machine that will participate in distributed transactions.

4. Execute the database script xa_install.sql on every SQL Server machine that will participate in distributed transactions.


5. Check that apollo db user has execute permission to the "master" database because xa_install.sql installs procedures in the master database.


Reference:

http://msdn.microsoft.com/en-us/library/aa342335.aspx
http://www.microsoft.com/downloads/details.aspx?FamilyID=99B21B65-E98F-4A61-B811-19912601FDC9&displaylang=en

No comments:

Post a Comment