/** * 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(); } }