/** * Simply close the proxied connection if there is no active transaction. Or register a * {@link ConnectionClosingSynchronization} if active transaction exists. * * @throws JMSException if transaction service has failed (in unexpected way) to obtain transaction status, * or if synchronization registration, or connection closing has failed. */ @Override public void close() throws JMSException { if (transactionHelper.isTransactionAvailable()) { Synchronization synchronization = new ConnectionClosingSynchronization(xaConnection); transactionHelper.registerSynchronization(synchronization); if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("Registered synchronization to close the connection: " + synchronization); } } else { xaConnection.close(); } }
/** * Simply close the proxied connection if there is no active transaction. Or register a * {@link ConnectionClosingSynchronization} if active transaction exists. * * @throws JMSException if transaction service has failed (in unexpected way) to obtain transaction status, * or if synchronization registration, or connection closing has failed. */ @Override public void close() throws JMSException { if (transactionHelper.isTransactionAvailable()) { Synchronization synchronization = new ConnectionClosingSynchronization(xaConnection); transactionHelper.registerSynchronization(synchronization); if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("Registered synchronization to close the connection: " + synchronization); } } else { xaConnection.close(); } }
/** * Simply close the proxied connection if there is no active transaction. Or register a * {@link ConnectionClosingSynchronization} if active transaction exists. * * @throws JMSException if transaction service has failed (in unexpected way) to obtain transaction status, * or if synchronization registration, or connection closing has failed. */ @Override public void close() throws JMSException { if (transactionHelper.isTransactionAvailable()) { Synchronization synchronization = new ConnectionClosingSynchronization(xaConnection); transactionHelper.registerSynchronization(synchronization); if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("Registered synchronization to close the connection: " + synchronization); } } else { xaConnection.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(); } }
/** * 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(); } }