Thursday, June 7, 2012

JTA Transaction Manager(XA) - Analysis


Requirements
We needs JTA complaint XA transaction manager since we have multiple resources
  • Database - Mysql
  • Cache - Infinispan
Both of these resources support XA - JTA transactions. - Mysql through com.mysql.jdbc.jdbc2.optional.MysqlXADataSource.
Alternatives for transaction manager 
We also need to choose a connection pool framework for database which is XA complaint. Hence options
Picking the right combination
  1. Atomokis transaction Manager + Atomikos connection pooling 
  • Easy configurations with Spring
  • JTA implementation comes with connection Pooling & Datasource (no need of seperate JCA)
  • Does support synchronization
  • Does not support last resource optimization
2. Jboss transaction Manager

      Jboss does not come with default connection pool  or JCA to be used in Standalone mode. Hence it is ideal with server liek Jboss and not in standalone mode
       Issues 
   1. Tried Jboss TM + DBCl Connection pool(XA) as suggested in  - http://lafernando.com/2011/01/05/xa-transactions-with-apache-dbcp/
   Faced issues were in connections got exhasted and where not returned to the pool
  2. Then tried to replace DBCP with Tomcat jdbc pool - which is the advanced version of dbcp overcoming its drawbacks
   Even though jdbc pool claims to have XA support , did not find much info about it in the net. When I tried the datasource did not seem to take part in the transaction.
 So the optiosn for JCA where 
Both these did not have any great documentation for use in standalone environment.
Based on all the above we will switch back to Atomikos  because
  1. It has Support
  2. Good documentation/ examples
  3. Seems to be widely used

No comments:

 
Free Domain Names @ .co.nr!