/** * @return Rollback future. */ public IgniteInternalFuture<IgniteInternalTx> rollbackNearTxLocalAsync() { return rollbackNearTxLocalAsync(true, false); }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<IgniteInternalTx> rollbackAsync() { return rollbackNearTxLocalAsync(); }
/** * @throws IgniteCheckedException If failed. */ public void rollback() throws IgniteCheckedException { rollbackNearTxLocalAsync().get(); }
@Override public void run() { // Note: if rollback asynchronously on timeout should not clear thread map // since thread started tx still should be able to see this tx. rollbackNearTxLocalAsync(false, true); U.warn(log, "The transaction was forcibly rolled back because a timeout is reached: " + CU.txString(GridNearTxLocal.this)); } });
/** {@inheritDoc} */ @Override public IgniteInternalFuture<IgniteInternalTx> apply(IgniteInternalTx tx, IgniteTxManager tm) { return tx.isRollbackOnly() || tx.state() == COMMITTING || tx.state() == COMMITTED ? new GridFinishedFuture<>() : ((GridNearTxLocal)tx).rollbackNearTxLocalAsync(false, false); } }
@Override public GridCacheReturn applyx(IgniteInternalFuture<IgniteInternalTx> txFut) throws IgniteCheckedException { try { txFut.get(); return new GridCacheReturn(cacheCtx, true, keepBinary, implicitRes.value(), implicitRes.success()); } catch (IgniteCheckedException | RuntimeException e) { rollbackNearTxLocalAsync(); throw e; } } }));
/** * @param tx Transaction to rollback. * @throws IgniteCheckedException If failed. * @return Rollback future. */ public IgniteInternalFuture rollbackTxAsync(GridNearTxLocal tx) throws IgniteCheckedException { boolean clearThreadMap = txMgr.threadLocalTx(null) == tx; if (clearThreadMap) tx.txState().awaitLastFuture(this); else tx.state(MARKED_ROLLBACK); return tx.rollbackNearTxLocalAsync(clearThreadMap, false); }
/** * Rollback transactions blocking partition map exchange. * * @param topVer Initial exchange version. */ public void rollbackOnTopologyChange(AffinityTopologyVersion topVer) { for (IgniteInternalTx tx : activeTransactions()) { if (tx.local() && tx.near() && needWaitTransaction(tx, topVer)) { U.warn(log, "The transaction was forcibly rolled back on partition map exchange because a timeout is " + "reached: [tx=" + CU.txString(tx) + ", topVer=" + topVer + ']'); ((GridNearTxLocal)tx).rollbackNearTxLocalAsync(false, false); } } }
@Override public GridCacheReturn applyx(IgniteInternalFuture<IgniteInternalTx> txFut) throws IgniteCheckedException { try { txFut.get(); Object res = implicitRes.value(); if (implicitRes.invokeResult()) { assert res == null || res instanceof Map : implicitRes; res = cacheCtx.unwrapInvokeResult((Map)res, keepBinary); } return new GridCacheReturn(cacheCtx, true, keepBinary, res, implicitRes.success()); } catch (IgniteCheckedException | RuntimeException e) { if (!(e instanceof NodeStoppingException)) rollbackNearTxLocalAsync(); throw e; } } }
rollbackNearTxLocalAsync(clearThreadMap, false).get();
if (tx != null) { try { return tx.rollbackNearTxLocalAsync();
/** * @return Rollback future. */ public IgniteInternalFuture<IgniteInternalTx> rollbackNearTxLocalAsync() { return rollbackNearTxLocalAsync(true, false); }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<IgniteInternalTx> rollbackAsync() { return rollbackNearTxLocalAsync(); }
/** * @throws IgniteCheckedException If failed. */ public void rollback() throws IgniteCheckedException { rollbackNearTxLocalAsync().get(); }
@Override public void run() { // Note: if rollback asynchronously on timeout should not clear thread map // since thread started tx still should be able to see this tx. rollbackNearTxLocalAsync(false, true); U.warn(log, "The transaction was forcibly rolled back because a timeout is reached: " + CU.txString(GridNearTxLocal.this)); } });
/** * Rollback all active transactions with acquired Mvcc snapshot. */ public void rollbackMvccTxOnCoordinatorChange() { for (IgniteInternalTx tx : activeTransactions()) { if (tx.mvccSnapshot() != null) ((GridNearTxLocal)tx).rollbackNearTxLocalAsync(false, false); } }
/** {@inheritDoc} */ @Override public IgniteInternalFuture<IgniteInternalTx> apply(IgniteInternalTx tx, IgniteTxManager tm) { return tx.isRollbackOnly() || tx.state() == COMMITTING || tx.state() == COMMITTED ? new GridFinishedFuture<>() : ((GridNearTxLocal)tx).rollbackNearTxLocalAsync(false, false); } }
/** * @param tx Transaction to rollback. * @throws IgniteCheckedException If failed. * @return Rollback future. */ public IgniteInternalFuture rollbackTxAsync(GridNearTxLocal tx) throws IgniteCheckedException { boolean clearThreadMap = txMgr.threadLocalTx(null) == tx; if (clearThreadMap) tx.txState().awaitLastFuture(this); else tx.state(MARKED_ROLLBACK); return tx.rollbackNearTxLocalAsync(clearThreadMap, false); }
@Override public GridCacheReturn applyx(IgniteInternalFuture<IgniteInternalTx> txFut) throws IgniteCheckedException { try { txFut.get(); return new GridCacheReturn(cacheCtx, true, keepBinary, implicitRes.value(), implicitRes.success()); } catch (IgniteCheckedException | RuntimeException e) { rollbackNearTxLocalAsync(); throw e; } } }));
/** * Rollback transactions blocking partition map exchange. * * @param topVer Initial exchange version. */ public void rollbackOnTopologyChange(AffinityTopologyVersion topVer) { for (IgniteInternalTx tx : activeTransactions()) { if (tx.local() && tx.near() && needWaitTransaction(tx, topVer)) { U.warn(log, "The transaction was forcibly rolled back on partition map exchange because a timeout is " + "reached: [tx=" + CU.txString(tx) + ", topVer=" + topVer + ']'); ((GridNearTxLocal)tx).rollbackNearTxLocalAsync(false, false); } } }