/** * Removes Tx from manager. Can be used only if there were no updates. * * @param tx Transaction to finish. */ public void forgetTx(IgniteInternalTx tx) { assert tx != null; if (transactionMap(tx).remove(tx.xidVersion(), tx)) { // 1. Remove from per-thread storage. clearThreadMap(tx); // 2. Unregister explicit locks. if (!tx.alternateVersions().isEmpty()) for (GridCacheVersion ver : tx.alternateVersions()) idMap.remove(ver); // 3. Remove Near-2-DHT mappings. if (tx instanceof GridCacheMappedVersion) mappedVers.remove(((GridCacheMappedVersion)tx).mappedVersion()); // 4. Clear context. resetContext(); // 5. Complete finish future. tx.state(UNKNOWN); } }
/** * Suspends transaction. * Should not be used directly. Use tx.suspend() instead. * * @param tx Transaction to be suspended. * * @see #resumeTx(GridNearTxLocal, long) * @see GridNearTxLocal#suspend() * @see GridNearTxLocal#resume() * @throws IgniteCheckedException If failed to suspend transaction. */ public void suspendTx(final GridNearTxLocal tx) throws IgniteCheckedException { assert tx != null && !tx.system() : tx; if (!tx.state(SUSPENDED)) { throw new IgniteCheckedException("Trying to suspend transaction with incorrect state " + "[expected=" + ACTIVE + ", actual=" + tx.state() + ']'); } clearThreadMap(tx); transactionMap(tx).remove(tx.xidVersion(), tx); }
cctx.tm().clearThreadMap(this);
/** * Suspends transaction. * Should not be used directly. Use tx.suspend() instead. * * @param tx Transaction to be suspended. * * @see #resumeTx(GridNearTxLocal, long) * @see GridNearTxLocal#suspend() * @see GridNearTxLocal#resume() * @throws IgniteCheckedException If failed to suspend transaction. */ public void suspendTx(final GridNearTxLocal tx) throws IgniteCheckedException { assert tx != null && !tx.system() : tx; if (!tx.state(SUSPENDED)) { throw new IgniteCheckedException("Trying to suspend transaction with incorrect state " + "[expected=" + ACTIVE + ", actual=" + tx.state() + ']'); } clearThreadMap(tx); transactionMap(tx).remove(tx.xidVersion(), tx); }
cctx.tm().clearThreadMap(this);