/** {@inheritDoc} */ @Nullable @Override public GridNearTxLocal tx() { return ctx.tm().threadLocalTx(ctx); }
/** * @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); }
/** */ protected GridNearTxLocal checkCurrentTx() { if (!ctx.mvccEnabled()) return ctx.tm().threadLocalTx(ctx); try { return MvccUtils.currentTx(ctx.kernalContext(), null); } catch (MvccUtils.UnsupportedTxModeException | MvccUtils.NonMvccTransactionException e) { throw new TransactionException(e.getMessage()); } }
validateCacheKeys(keys); GridNearTxLocal tx = ctx.tm().threadLocalTx(ctx);
@Override public void run() { for (int i = 0; i < txCnt; i++) { GridNearTxLocal tx0 = ctx.tm().threadLocalTx(cctx); assertTrue(tx0 == null || tx0.state() == ROLLED_BACK); try (Transaction tx = tryLockNode.transactions().txStart(PESSIMISTIC, REPEATABLE_READ, useTimeout ? 50 : 0, 1)) { txReadyFut.onDone(tx); // Will block on lock request until rolled back asynchronously. Object o = tryLockNode.cache(CACHE_NAME).getAndPut(0, 0); assertNull(o); // If rolled back by close, previous get will return null. } catch (Exception e) { // If rolled back by rollback, previous get will throw an exception. } } txReadyFut.onDone((Transaction)null); } }, 1, "tx-get-thread");
/** {@inheritDoc} */ @Nullable @Override public GridNearTxLocal tx() { return ctx.tm().threadLocalTx(ctx); }
/** * @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); }
validateCacheKeys(keys); GridNearTxLocal tx = ctx.tm().threadLocalTx(ctx);
validateCacheKeys(keys); GridNearTxLocal tx = (ctx.mvccEnabled()) ? MvccUtils.tx(ctx.kernalContext()) : ctx.tm().threadLocalTx(ctx);
tx = ctx.tm().threadLocalTx(ctx);
validateCacheKey(key); GridNearTxLocal tx = ctx.mvccEnabled() ? MvccUtils.tx(ctx.kernalContext()) : ctx.tm().threadLocalTx(ctx);
log.debug("Performing async op: " + op); GridNearTxLocal tx = ctx.tm().threadLocalTx(ctx);
GridNearTxLocal tx = ctx.tm().threadLocalTx(ctx);