How to use Atomikos as the transaction manager in jetty6
These instructions have been verified against Atomikos 2.10, 3.0.1, and 3.4.2
Step 1: Copy the Atomikos jars
Copy the following jars from your Atomikos installation to the jetty6
Step 2: Copy and install the Atomikos console webapp
Copy the following webapp to a jetty6 deployment directory, for example
If you are using the
etc/jetty-plus.xml configuration file and you are deploying from
webapps-plus you won't need to configure the webapp for jetty6, as the
etc/jetty-plus.xml file automatically deploys everything in
webapps-plus. If you are doing something different, you can use the following xml snippet to configure the Atomikos console webapp for jetty6:
Don't forget to substitute
MY/DEPLOY/DIRECTORY with the location of your deploy directory.
Step 3: Configure Atomikos as the transaction manager
Copy the following into your jetty config file:
Step 4: Configure DataSources that are transaction aware
The easiest way to do this is to use the DataSources that ship with Atomikos. Atomikos provides two different flavours of DataSource. One is for use with database datasources that are XADataSource compliant (ie they fully participate in two phase commits), and another which allows non-XA aware datasources to nevertheless work with the transaction manager (however some XA features such as pending transaction recovery will not be available).
Here's an example of using Atomikos with a DataSource that implements
com.atomikos.jdbc.SimpleDataSourceBean ( or
com.atomikos.jdbc.AtomikosDataSourceBean since 3.3.x) implements
javax.sql.DataSource and interacts with the javax.sql.XADataSource provided in this instance by Derby.
If your database vendor does not provide an XADataSource, you can use Atomikos's
com.atomikos.jdbc.nonxa.NonXADataSourceBean to allow your database connections to be controlled by the transaction manager:
There is more documentation available from the Atomikos site on using their DataSources.