Remove connection from pool if it fails to enlist
-------------------------------------------------

                 Key: GERONIMO-5870
                 URL: https://issues.apache.org/jira/browse/GERONIMO-5870
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: connector
    Affects Versions: 2.1.3
            Reporter: Florent Guillaume
            Priority: Minor


When a connection fails to enlist, it should be removed from its pool.

Consider the following:

ConnectionFactory.getConnection
-> 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 XAER_RMERR.
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.

I suggest that TransactionEnlistingInterceptor.getConnection look for a false 
return value when calling enlistResource and in this case doing a DESTROY as 
well.

Patch for 2.1.3 coming up, I'll create one for 3.1 as well.

Sorry for no unit test, but I'm running out of time.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to