tx.commit(); } catch (CommitConflictException ex) { saveTXStateForClientFailover(tx, TXCommitMessage.CMT_CONFLICT_MSG); //fixes #43350 noteCommitFailure(opStart, lifeTime, tx); saveTXStateForClientFailover(tx, TXCommitMessage.REBALANCE_MSG); throw e; } catch (RuntimeException e) { saveTXStateForClientFailover(tx, TXCommitMessage.EXCEPTION_MSG); saveTXStateForClientFailover(tx); cleanup(tx.getTransactionId()); noteCommitSuccess(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 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); }