"(current thread already has a transaction): " + tx); tx = cctx.tm().newTx( false, false,
/** * @param ctx Grid kernal context. * @param cctx Cache context. * @param timeout Transaction timeout. * @return Newly started SQL transaction. */ private static GridNearTxLocal txStart(GridKernalContext ctx, @Nullable GridCacheContext cctx, long timeout) { if (timeout == 0) { TransactionConfiguration tcfg = CU.transactionConfiguration(cctx, ctx.config()); if (tcfg != null) timeout = tcfg.getDefaultTxTimeout(); } GridNearTxLocal tx = ctx.cache().context().tm().newTx( false, false, cctx != null && cctx.systemTx() ? cctx : null, PESSIMISTIC, REPEATABLE_READ, timeout, cctx == null || !cctx.skipStore(), true, 0, null ); tx.syncMode(FULL_SYNC); return tx; }
.getTransactionConfiguration(); tx = cctx.tm().newTx( /*implicit*/false, /*implicit single*/false,
/** * @param ignite Ignite. */ private void injectMockedTxManager(Ignite ignite) { IgniteEx igniteEx = (IgniteEx)ignite; GridCacheSharedContext<Object, Object> ctx = igniteEx.context().cache().context(); IgniteTxManager tm = ctx.tm(); IgniteTxManager mockTm = Mockito.spy(tm); MockGridNearTxLocal locTx = new MockGridNearTxLocal(ctx, false, false, false, GridIoPolicy.SYSTEM_POOL, TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ, 0, true, null, 1, null, 0, null); Mockito.doAnswer(new Answer<GridNearTxLocal>() { @Override public GridNearTxLocal answer(InvocationOnMock invocation) throws Throwable { mockTm.onCreated(null, locTx); return locTx; } }).when(mockTm). newTx(locTx.implicit(), locTx.implicitSingle(), null, locTx.concurrency(), locTx.isolation(), locTx.timeout(), locTx.storeEnabled(), null, locTx.size(), locTx.label()); ctx.setTxManager(mockTm); }
tx = ctx.tm().newTx( true, op.single(),
tx = ctx.tm().newTx( true, op.single(),
"(current thread already has a transaction): " + tx); tx = cctx.tm().newTx( false, false,
/** * @param ctx Grid kernal context. * @param cctx Cache context. * @param timeout Transaction timeout. * @return Newly started SQL transaction. */ private static GridNearTxLocal txStart(GridKernalContext ctx, @Nullable GridCacheContext cctx, long timeout) { if (timeout == 0) { TransactionConfiguration tcfg = CU.transactionConfiguration(cctx, ctx.config()); if (tcfg != null) timeout = tcfg.getDefaultTxTimeout(); } GridNearTxLocal tx = ctx.cache().context().tm().newTx( false, false, cctx != null && cctx.systemTx() ? cctx : null, PESSIMISTIC, REPEATABLE_READ, timeout, cctx == null || !cctx.skipStore(), true, 0, null ); tx.syncMode(FULL_SYNC); return tx; }
.getTransactionConfiguration(); tx = cctx.tm().newTx( /*implicit*/false, /*implicit single*/false,
tx = ctx.tm().newTx( true, op.single(),
tx = ctx.tm().newTx( true, op.single(),