/** * Resume transaction if it was previously suspended. * * @param tx Transaction to resume. * @throws IgniteCheckedException If resume failed. */ public void resumeTx(GridNearTxLocal tx) throws IgniteCheckedException { tx.txState().awaitLastFuture(this); tx.resume(); }
/** * Suspends transaction. It could be resume later. Supported only for optimistic transactions. * * @param tx Transaction to suspend. * @throws IgniteCheckedException If suspension failed. */ public void suspendTx(GridNearTxLocal tx) throws IgniteCheckedException { tx.txState().awaitLastFuture(this); tx.suspend(); }
/** * @param awaitLastFuture If true - method will wait until transaction finish every action started before. * @throws IgniteCheckedException If failed. */ public final void prepare(boolean awaitLastFuture) throws IgniteCheckedException { if (awaitLastFuture) txState().awaitLastFuture(cctx); prepareNearTxLocal().get(); }
/** * @param tx Transaction to close. * @throws IgniteCheckedException If failed. */ public void endTx(GridNearTxLocal tx) throws IgniteCheckedException { boolean clearThreadMap = txMgr.threadLocalTx(null) == tx; if (clearThreadMap) tx.txState().awaitLastFuture(this); else tx.state(MARKED_ROLLBACK); tx.close(clearThreadMap); }
/** * @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); }
/** * @param tx Transaction to commit. * @return Commit future. */ @SuppressWarnings("unchecked") public IgniteInternalFuture<IgniteInternalTx> commitTxAsync(GridNearTxLocal tx) { GridCacheContext ctx = tx.txState().singleCacheContext(this); if (ctx == null) { tx.txState().awaitLastFuture(this); return tx.commitNearTxLocalAsync(); } else return ctx.cache().commitTxAsync(tx); }
tx0.txState().awaitLastFuture(ctx.shared());
/** * Resume transaction if it was previously suspended. * * @param tx Transaction to resume. * @throws IgniteCheckedException If resume failed. */ public void resumeTx(GridNearTxLocal tx) throws IgniteCheckedException { tx.txState().awaitLastFuture(this); tx.resume(); }
/** * Suspends transaction. It could be resume later. Supported only for optimistic transactions. * * @param tx Transaction to suspend. * @throws IgniteCheckedException If suspension failed. */ public void suspendTx(GridNearTxLocal tx) throws IgniteCheckedException { tx.txState().awaitLastFuture(this); tx.suspend(); }
/** * @param awaitLastFuture If true - method will wait until transaction finish every action started before. * @throws IgniteCheckedException If failed. */ public final void prepare(boolean awaitLastFuture) throws IgniteCheckedException { if (awaitLastFuture) txState().awaitLastFuture(cctx); prepareNearTxLocal().get(); }
/** * @param tx Transaction to close. * @throws IgniteCheckedException If failed. */ public void endTx(GridNearTxLocal tx) throws IgniteCheckedException { boolean clearThreadMap = txMgr.threadLocalTx(null) == tx; if (clearThreadMap) tx.txState().awaitLastFuture(this); else tx.state(MARKED_ROLLBACK); tx.close(clearThreadMap); }
/** * @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); }
/** * @param tx Transaction to commit. * @return Commit future. */ @SuppressWarnings("unchecked") public IgniteInternalFuture<IgniteInternalTx> commitTxAsync(GridNearTxLocal tx) { GridCacheContext ctx = tx.txState().singleCacheContext(this); if (ctx == null) { tx.txState().awaitLastFuture(this); return tx.commitNearTxLocalAsync(); } else return ctx.cache().commitTxAsync(tx); }
tx0.txState().awaitLastFuture(ctx.shared());