@Override public void cleanupCachedLocalState(boolean hasListeners) { this.lock.lock(); try { // mark TXStateProxy as closed before clearing the local TXState so that // any new TXState cannot be created this.state.set(State.CLOSED); final TXState localState = this.localTXState; if (localState != null) { localState.cleanupCachedLocalState(hasListeners); this.localTXState = null; } } finally { this.lock.unlock(); } this.txManager.cleanup(this.txId); }
cleanup(tx.getTransactionId()); // fixes #52086 throw ex; } catch (TransactionDataRebalancedException reb) { saveTXStateForClientFailover(tx, TXCommitMessage.REBALANCE_MSG); cleanup(tx.getTransactionId()); // fixes #52086 throw reb; } catch (UnsupportedOperationInTransactionException e) { } catch (RuntimeException e) { saveTXStateForClientFailover(tx, TXCommitMessage.EXCEPTION_MSG); cleanup(tx.getTransactionId()); // fixes #52086 throw e; 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); }