// with resources fully supporting transaction interleaving.
if (isInEnlistingGlobalTransactionContext(xaResourceHolder, currentTransaction) && !bean.getDeferConnectionRelease()) {
Map statesForGtrid = xaResourceHolder.getXAResourceHolderStatesForGtrid(currentTransaction.getResourceManager().getGtrid());
Iterator statesForGtridIt = statesForGtrid.values().iterator();
while (statesForGtridIt.hasNext()) {
XAResourceHolderState xaResourceHolderState = (XAResourceHolderState) statesForGtridIt.next();
if (!xaResourceHolderState.isEnded()) {
if (log.isDebugEnabled()) log.debug("delisting resource " + xaResourceHolderState + " from " + currentTransaction);
// Watch out: the delistResource() call might throw a BitronixRollbackSystemException to indicate a unilateral rollback.
currentTransaction.delistResource(xaResourceHolderState.getXAResource(), XAResource.TMSUCCESS);
}
else if (log.isDebugEnabled()) log.debug("avoiding delistment of not enlisted resource " + xaResourceHolderState);
}
} // isInEnlistingGlobalTransactionContext