How to use BTM as the transaction manager in Tomcat 5.5.x
These instructions have been verified against BTM 1.1.
These instructions are for BTM 1.2 and earlier only. BTM 1.3 instructions are here.
|Table of Contents|
Step 1: Copy the BTM jars
Copy the following jars from the BTM distribution to the Tomcat
- slf4j-jdk14.jar (or any other one available here)
Step 2: Configure BTM as the transaction manager
Windows: Create a file named
setenv.bat with the following commands under Tomcat's
Finally, create an empty file named
resources.properties under Tomcat's
Step 3: Configure datasources that are transaction aware
You have to put your datasources configurations in Tomcat's
conf/resources.properties file. Here's an example of using BTM with a DataSource that implements javax.sql.XADataSource:
Again, we've used Derby as an example, but as the
LrcXADataSource uses only the class name and url of a
java.sql.Driver, you can use it with any database providing a JDBC driver.
Step 4: Configure transaction manager and datasources initialization in your META-INF/context.xml
In the web application where you want one or more datasource to be used, you have to create a META-INF/context.xml file.
<Transaction> tag will just bind the transaction manager at the standard JNDI location
Step 5: Configure datasources references in your web.xml
Before your code can access configured datasources via JNDI ENC URLs, you need to declare resource references in your