Subject XAResourceRecovery
Author jason.cone
I am looking at setting up XAResourceRecovery for Jaybird datasources in JBoss (Jaybird 2.1.6, JBoss 4.2.0.GA). I'm considering a couple of options, and would appreciate any comments or feedback on their merits and pitfalls from developers who are more familiar and experienced with the Jaybird code and implementation.

There is a XAResourceRecovery implementation available (AppServerJDBCXARecovery), here:
http://www.jboss.org/feeds/post/transaction_recovery_in_jbossas

However, AppServerJDBCXARecovery expects the datasource's ManagedConnectionFactory to implement XADataSource. FBManagedConnectionFactory (which is how my datasources are currently configured) doesn't implement XADataSource.

Possibilities I'm looking at:

1. Implement my own XAResourceRecovery class that uses JMX to get the FBManagedConnectionFactory instance and calls createManagedConnection() on the FBMCF to get a FBManagedConnection. FBManagedConnection implements XAResource, an that's what XAResourceRecovery.getXAResource needs to return, so I return the FBMC.

2. Configure the datasource to use FBConnectionPoolDataSource (which implements XADataSource). I guess this would mean a -ds config file using <xa-datasource> and <xa-datasource-class>, rather than <tx-connection-factory>? Use the AppServerJDBCXARecovery class along with this configuration.

Any comments or advice are appreciated.