XA transaction optimized into 1 phase commit transaction when using the same database.
I have a question about the XA transaction management. Consider this scenario: there is a XADataSource connecting to a MySQL server. There is also a JMS connection that uses a JDBC store in the same database (configured to use XA transactions). The MySQL connection parameters use the same 'resourceId' property, so that the XAResource.isSameRM() returns true for both the XADatasource and the JMS JDBC store (as described here: http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configurati...). Then there is a transaction that writes in both the XADatasource and the JMS connection.
Is it possible for Glassfish to figure out that is the same database/resource and optimize the 2 phase commit/XA transaction into a one phase commit transaction?
I know that if I set for example the JMS JDBC store to use Local transactions, the 'last resource optimization' will kick in; but will it still use the a 2 phase commit for the XADataSource? I am not sure how to interpret the documentation.
Any help is appreciated.