[ XA ] - isSameRM method is it correct?
Posted by: Nicolas Barrera
Date: February 11, 2014 01:12PM

Hi all,

I wanted to ask about the isSameRM method implementation in the class MysqlXAConnection.

While the javadoc says that this is a method to decide if two resources belong to the same Resource Manager, the implementation seems to compare the two resources each other and return true when both resources are the same (not when their resource manager is the same!).

The method isSameResource compares two connections firstly by it's connection url so for example two different connections to two different database schema between the same mysql server will return FALSE.

So my problem araises when I try to use JBOSS TS to impact two different databases in the same mysql server. The JB team is telling me that they 're expecting that the XA START command of the second transaction should be detecting that it's the same resource manager and return TRUE in isSameRM.

Here is the JBOSSTS forum link where I explain my scenario in detail: https://community.jboss.org/thread/236546

Could it be that this implementation is wrong? Or is there any explanation for mysql returning false in isSameRM for the second transaction (a tx to a different database but in the same mysql server).

thank you,
Nicolas.-


---- SNIPPET
/**
* This method is called to determine if the resource manager instance
* represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
* @parameter xares An XAResource object whose resource manager instance is
* to be compared with the resource manager instance of the
* target object.
*
* @return true if it's the same RM instance; otherwise false.
*
* @throws XAException
* An error has occurred. Possible exception values are
* XAER_RMERR and XAER_RMFAIL.
*/
public boolean isSameRM(XAResource xares) throws XAException {

if (xares instanceof MysqlXAConnection) {
return this.underlyingConnection
.isSameResource(((MysqlXAConnection) xares).underlyingConnection);
}

return false;
}
---- SNIPPET

Options: ReplyQuote


Subject
Written By
Posted
[ XA ] - isSameRM method is it correct?
February 11, 2014 01:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.