Configuring MySQL for XA

22 Jul 2015 - 07:21 | Version 8 | | ,

Tomcat context.xml JNDI example

<Resource name="jdbc/YourDbPool" auth="Container" 
 driverClassName="com.mysql.jdbc.Driver" 
 password="yourdbpass" 
 type="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"  
 factory="com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory"
 url="jdbc:mysql://server.example.com:3306/" explicitUrl="true"
 pinGlobalTxToPhysicalConnection="true"
 user="yourdbuser">
</Resource>

Notes

Tested with Tomcat 5.5, MySQL 5.0.2, and JDBC driver MySQL Connector 5.1.5.

Calling initialContext.lookup(poolname) may return a null DataSource; use initialContext.lookupLink(poolname) instead.

-- JennyBrown - 1 Dec 2008

Contact Us

Atomikos Corporate Headquarters
Hoveniersstraat, 39/1, 2800
Mechelen, Belgium

E info@atomikos.com
E sales@atomikos.com
T +3215613055

Subscribe to our newsletter

Never miss an update

Copyright 2016 Atomikos BVBA