/** * Forget * * @param xid A global transaction identifier * @throws XAException An error has occurred */ @Override public void forget(final Xid xid) throws XAException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("forget(" + xid + ")"); } managedConnection.lock(); try { xaResource.forget(xid); } finally { managedConnection.setInManagedTx(true); managedConnection.setInManagedTx(false); managedConnection.unlock(); } }
/** * Forget * * @param xid A global transaction identifier * @throws XAException An error has occurred */ @Override public void forget(final Xid xid) throws XAException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("forget(" + xid + ")"); } managedConnection.lock(); try { xaResource.forget(xid); } finally { managedConnection.setInManagedTx(true); managedConnection.setInManagedTx(false); managedConnection.unlock(); } }
/** * End * * @param xid A global transaction identifier * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND. * @throws XAException An error has occurred */ @Override public void end(final Xid xid, final int flags) throws XAException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("end(" + xid + ", " + flags + ")"); } managedConnection.lock(); try { xaResource.end(xid, flags); } finally { managedConnection.setInManagedTx(false); managedConnection.unlock(); } }
/** * End * * @param xid A global transaction identifier * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND. * @throws XAException An error has occurred */ @Override public void end(final Xid xid, final int flags) throws XAException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("end(" + xid + ", " + flags + ")"); } managedConnection.lock(); try { xaResource.end(xid, flags); } finally { managedConnection.setInManagedTx(false); managedConnection.unlock(); } }
/** * Start * * @param xid A global transaction identifier * @param flags One of TMNOFLAGS, TMJOIN, or TMRESUME * @throws XAException An error has occurred */ @Override public void start(final Xid xid, final int flags) throws XAException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("start(" + xid + ", " + flags + ")"); } managedConnection.lock(); ClientSessionInternal sessionInternal = (ClientSessionInternal) xaResource; try { try { //this resets any tx stuff, we assume here that the tm and jca layer are well behaved when it comes to this sessionInternal.resetIfNeeded(); } catch (ActiveMQException e) { ActiveMQRALogger.LOGGER.problemResettingXASession(e); XAException xaException = new XAException(XAException.XAER_RMFAIL); xaException.initCause(e); throw xaException; } xaResource.start(xid, flags); } finally { managedConnection.setInManagedTx(true); managedConnection.unlock(); } }
/** * Start * * @param xid A global transaction identifier * @param flags One of TMNOFLAGS, TMJOIN, or TMRESUME * @throws XAException An error has occurred */ @Override public void start(final Xid xid, final int flags) throws XAException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("start(" + xid + ", " + flags + ")"); } managedConnection.lock(); ClientSessionInternal sessionInternal = (ClientSessionInternal) xaResource; try { try { //this resets any tx stuff, we assume here that the tm and jca layer are well behaved when it comes to this sessionInternal.resetIfNeeded(); } catch (ActiveMQException e) { ActiveMQRALogger.LOGGER.problemResettingXASession(e); XAException xaException = new XAException(XAException.XAER_RMFAIL); xaException.initCause(e); throw xaException; } xaResource.start(xid, flags); } finally { managedConnection.setInManagedTx(true); managedConnection.unlock(); } }