users@glassfish.java.net

XA transaction optimized into 1 phase commit transaction when using the same

From: <forums_at_java.net>
Date: Mon, 4 Apr 2011 08:43:50 -0500 (CDT)

Hi,

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-configuration-properties.html
[1]). 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.

Thanks. Mircea.


[1]
http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html

--
[Message sent by forum member 'crocodilu']
View Post: http://forums.java.net/node/788290