}
}
protected boolean internalReturn(ConnectionInfo connectionInfo, ConnectionReturnAction connectionReturnAction) {
ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo();
ManagedConnection mc = mci.getManagedConnection();
try {
mc.cleanup();
} catch (ResourceException e) {
connectionReturnAction = ConnectionReturnAction.DESTROY;
}
boolean wasInPool = false;
synchronized (pool) {
// a bit redundant with returnConnection check in AbstractSinglePoolConnectionInterceptor,
// but checking here closes a small timing hole...
if (destroyed) {
try {
mc.destroy();
}
catch (ResourceException re) { } // ignore
return pool.remove(mci);
}