(JBoss Branch_3_0, though I've also verified this on HEAD)
 
I think I've discovered a source of generic XA_PROTO errors.  When an XA connection is closed (see org/jboss/resource/connectionmanager/XATxConnectionManager$XAConnectionEventListener.connectionClosed[306]), it is first delisted from the Transaction Manager.  It used to be called with XAResource.TMSUCCESS, but about 5 weeks ago it was changed to use XAResource.TMSUSPEND.  This connection is now put back in the available pool.  Unfortunately, when the transaction is committed, it must first be re-enlist the resource and end it with a TMSUCCESS (see TxCapsule (3.0) or TransactionImpl (3.1) method, endResources).  The problem occurs if that connecction has been handed out to a requesting client, and it is already within the scope of another transaction.
 
The solutions I can see are:
1) Change back to TMSUCCESS on connectionClosed
2) Do not put the connection back in the pool until it has been ended with either TMSUCCESS or TMFAIL
3) As per the comments in TxCapsule (and TransactionImpl) do not re-enlist a suspended transaction before ending it.  This apparently violates the JTA spec, but complies with the XA/Open spec - perhaps an option could be set to toggle this?
 
Did I miss something?  Which of these solutions do you recommend?
 
Thanks
 
-Larry

Reply via email to