-
1. Re: How is the XA Enlistment Problem typically solved in a JEE environment
tomjenkinson Aug 11, 2014 9:05 AM (in response to cs224)Hi Christian,
Unfortunately there isn't a standard for auto-enlistment of XAResources into a transaction.
One of the mechanisms that is used in WildFly is a UserTransactionListener:
Alternatively, you can wrap the driver and when (for example) JDBC::getConnection() is called it can detect whether or not a transaction is inflight and if so it can perform the necessary enlistment operations. This is approach that appears to be advocated in the Fuse docs you referenced.
Hope it helps,
Tom
-
2. Re: How is the XA Enlistment Problem typically solved in a JEE environment
cs224 Sep 7, 2014 6:30 AM (in response to cs224)I have now finally gotten around to read J2EE Connector Architecture and Enterprise Application Integration (12.3.1 Creating new Connections; page 206)and thought it might help others to document here what I've learned.
It seems that the JEE containers perform the "auto enlistment" in the call sequence:
javax.resource.cci.ConnectionFactory.getConnection() ->
javax.resource.spi.ConnectionManager.allocateConnection() ->
javax.resource.spi.ManagedConnectionFactory.createManagedConnection()
The ConnectionFactory and the ManagedConnectionFactory are under the control of the ResourceAdapter and the ConnectionManager may be under the control of the JEE container. The spi.ManagedConnectionFactory also serves as a factory for the cci.ConnectionFactory [Object createConnectionFactory(ConnectionManager cxManager)] and at that point takes the ConnectionManager as an argument. Like that the ConnectionManager can intercept the getConnection() calls and perform the "auto enlistment".
-
3. Re: How is the XA Enlistment Problem typically solved in a JEE environment
jesper.pedersen Sep 8, 2014 2:28 PM (in response to cs224)JCA is cool that way
http://www.ironjacamar.org/doc/userguide/1.2/en-US/html/ch01.html#overview_outbound
http://www.ironjacamar.org/doc/userguide/1.2/en-US/html/ch08.html
You likely need a XATransaction capable resource adapter, and don't use CCI - it is horrible and broken. Feel free to join the IronJacamar community for additional pointers
-
4. Re: How is the XA Enlistment Problem typically solved in a JEE environment
cs224 Sep 11, 2014 9:43 AM (in response to jesper.pedersen)Wow, there is a complete resource adapter code generator. I did not know that. Thanks for pointing me towards the documentation. I will have a look at it and join the IronJacamar community.