QPID-3263, an issue has cropped up when two XAResources have the same underlying ResourceManager(RM). Originally the isSameRM method returned false regardless of whether or not the RM's were the same. Since we now return true when two or more XAResources are involved, we get an ILLEGAL_STATE exception being that the DtxStart/DtxEnd calls are not paired for each XAResource because the TransactionManager (TM) treats the XAResource(s) as being on the same transaction branch. As a result, DtxEnd is only called on one resource.
According to Gordon, this may be a discrepancy between XA and the AMQP .10 specification. This has inadvertently worked in the JCA code due to bug in the isSameRM method and the use of the QpidRAXAResourceWrapper.
While it might make sense to simply roll back to the old behavior, this is not going to perform as well being that most TM's can optimize underlying transaction state with isSameRM is true. This has performance implications for the TM in terms of logging, management etc.
I have a fix for this issue that allows XAResources to be aware of each other in a transaction chain. When DtxEnd is called on one resource, the sibling XAResources.end method is called thereby matching the DtxStart/DtxEnd invocations appropriately allowing the transaction to complete.