/** * Simply close proxied session if there is no active transaction. Or if transaction exists, delist session's XA resource * and register a {@link SessionClosingSynchronization} to close the proxied session. * * @throws JMSException */ @Override public void close() throws JMSException { if (transactionHelper.isTransactionAvailable()) { transactionHelper.deregisterXAResource(xaSession.getXAResource()); if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("Delisted " + xaSession + " XA resource from the transaction"); } Synchronization synchronization = new SessionClosingSynchronization(xaSession); transactionHelper.registerSynchronization(synchronization); if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("Registered synchronization to close the session: " + synchronization); } } else { xaSession.close(); } }
/** * Simply close proxied session if there is no active transaction. Or if transaction exists, delist session's XA resource * and register a {@link SessionClosingSynchronization} to close the proxied session. * * @throws JMSException */ @Override public void close() throws JMSException { if (transactionHelper.isTransactionAvailable()) { transactionHelper.deregisterXAResource(xaSession.getXAResource()); if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("Delisted " + xaSession + " XA resource from the transaction"); } Synchronization synchronization = new SessionClosingSynchronization(xaSession); transactionHelper.registerSynchronization(synchronization); if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("Registered synchronization to close the session: " + synchronization); } } else { xaSession.close(); } }
/** * Simply close proxied session if there is no active transaction. Or if transaction exists, delist session's XA resource * and register a {@link SessionClosingSynchronization} to close the proxied session. * * @throws JMSException */ @Override public void close() throws JMSException { if (transactionHelper.isTransactionAvailable()) { transactionHelper.deregisterXAResource(xaSession.getXAResource()); if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("Delisted " + xaSession + " XA resource from the transaction"); } Synchronization synchronization = new SessionClosingSynchronization(xaSession); transactionHelper.registerSynchronization(synchronization); if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("Registered synchronization to close the session: " + synchronization); } } else { xaSession.close(); } }