CompositeTransaction current = tm.getCompositeTransaction();
if ( ( current != null ) && ( current.getProperty ( TransactionManagerImp.JTA_PROPERTY_NAME) != null )) {
synchronized (sessions) {
for (int i=0; i<sessions.size() ;i++) {
Session session = (Session) sessions.get(i);
DynamicProxy dproxy = ( DynamicProxy ) session;
AbstractJmsSessionProxy proxy = (AbstractJmsSessionProxy) dproxy.getInvocationHandler();
//recycle if either inactive in this tx, OR if active (since a new session will be created anyway, and
//concurrent sessions are allowed on the same underlying connection!
if ( proxy.isInactiveTransaction(current) || proxy.isInTransaction( current ) ) {
if ( LOGGER.isInfoEnabled() ) LOGGER.logInfo ( this + ": recycling session " + proxy );