geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florent Guillaume>
Subject txmanager: shouldn't connection be removed from pool if it fails to enlist?
Date Fri, 11 Mar 2011 15:17:29 GMT
Hi David, all,

I have the following situation using txmanager (2.1.3) as a standalone
component in my application.

-> GenericConnectionManager.allocateConnection
-> TransactionEnlistingInterceptor.getConnection
-> TransactionImpl.enlistResource
-> xaRes.start
In my XAResource for internal reasons there's a failure to do the
start (no network resources available), and it throws XAException
So enlistResource catches this and returns false.
But the caller, TransactionEnlistingInterceptor.getConnection, does
nothing with the return code and assumes all went well. So the
corrupted XAResource stays in the pool and is still corrupted on the
next try.

In my opinion it should return the connection to the pool with a DESTROY action.

There's a code path catching SystemException where it does it, but
this exception is never raised here. I see two possible fixes:
1. make TransactionImpl.enlistResource throw SystemException at least
when getting XAER_RMERR,
2. make TransactionEnlistingInterceptor.getConnection look for a false
return value when calling enlistResource and in this case doing a
DESTROY as well.

What do you think?
I can provide a JIRA ticket and a patch if needed.


Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)   +33 1 40 33 79 87

View raw message