/** Roll back the transaction associated with the current * thread. When this method completes, the thread is no longer * associated with a transaction. */ public void rollback() { checkClosed(); TXStateProxy tx = getTXState(); if (tx == null) { throw new IllegalStateException(LocalizedStrings.TXManagerImpl_THREAD_DOES_NOT_HAVE_AN_ACTIVE_TRANSACTION.toLocalizedString()); } tx.checkJTA(LocalizedStrings.TXManagerImpl_CAN_NOT_ROLLBACK_THIS_TRANSACTION_IS_ENLISTED_WITH_A_JTA_TRANSACTION_USE_THE_JTA_MANAGER_TO_PERFORM_THE_ROLLBACK.toLocalizedString()); final long opStart = CachePerfStats.getStatTime(); final long lifeTime = opStart - tx.getBeginTime(); setTXState(null); tx.rollback(); saveTXStateForClientFailover(tx); cleanup(tx.getTransactionId()); noteRollbackSuccess(opStart, lifeTime, tx); }
/** * Roll back the transaction associated with the current thread. When this * method completes, the thread is no longer associated with a transaction. */ public final void rollback(final TXStateInterface tx, Object callbackArg, final boolean isRemoteRollback) { checkClosed(); if (tx == null) { throw new IllegalTransactionStateException(LocalizedStrings .TXManagerImpl_THREAD_DOES_NOT_HAVE_AN_ACTIVE_TRANSACTION .toLocalizedString()); } if (tx.isJTA()) { throw new IllegalTransactionStateException(LocalizedStrings .TXManagerImpl_CAN_NOT_ROLLBACK_THIS_TRANSACTION_IS_ENLISTED_WITH_A_JTA_TRANSACTION_USE_THE_JTA_MANAGER_TO_PERFORM_THE_ROLLBACK .toLocalizedString()); } final long opStart = CachePerfStats.getStatTime(); final long lifeTime = opStart - tx.getBeginTime(); TXManagerImpl.TXContext context = TXManagerImpl.currentTXContext(); if (context != null) { context.clearTXStateAll(); } tx.rollback(callbackArg); noteRollbackSuccess(opStart, lifeTime, tx, isRemoteRollback); }
rollback(null); lifeTime = opStart - getBeginTime(); this.txManager.noteRollbackSuccess(opStart, lifeTime, this, false); break; default:
this.proxy.getTxMgr().setTXState(null); rollback(); this.proxy.getTxMgr().noteRollbackSuccess(opStart, this.jtaLifeTime, this); break; default: