Subject Re: [Firebird-Java] XAResourceRecovery
Author Roman Rokytskyy
> 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.

I, personally, would use No. 1, but No. 2 is also ok. The only reason to
prefer MCF is that CPDS works via MCF, so at least one layer less. But
in general both solutions are equivalent - they use the same underlying
object.

Roman