BTM comes bundled with a JDBC XA connection pool which is very easy to configure. You basically have to create an instance of bitronix.tm.resource.jdbc.PoolingDataSource set some properties and you're done.
- Look up resources using the embedded JNDI provider.
- Another way is to bind a bitronix.tm.resource.ResourceObjectFactory object, passing it a javax.naming.Reference containing a javax.naming.StringRefAddr containing the datasource's
addrTypesomewhere in your JNDI tree. The
bitronix.tm.resource.ResourceObjectFactoryclass will just return the datasource with the specified
uniqueName. This is explained more in-depth in the Tomcat and Jetty integration page.
- The last way is to call bitronix.tm.resource.ResourceRegistrar.get(String uniqueName). This is the least preferred method as this ties your code to BTM which you probably want to avoid.