/** {@inheritDoc} */ @Override public Transaction txStart( TransactionConcurrency concurrency, TransactionIsolation isolation ) { return delegate.get().txStart(concurrency, isolation); }
/** {@inheritDoc} */ @Override public Transaction txStart( TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, int txSize ) { return delegate.get().txStart(concurrency, isolation, timeout, txSize); }
/** {@inheritDoc} */ @Override public Transaction txStart(TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, int txSize) { CacheOperationContext prev = gate.enter(opCtx); try { return delegate.txStart(concurrency, isolation, timeout, txSize); } finally { gate.leave(prev); } }
/** {@inheritDoc} */ @Override public Transaction txStart(TransactionConcurrency concurrency, TransactionIsolation isolation) { CacheOperationContext prev = gate.enter(opCtx); try { return delegate.txStart(concurrency, isolation); } finally { gate.leave(prev); } }
try (Transaction tx = serviceCache().txStart(PESSIMISTIC, READ_COMMITTED)) { for (String name : servicesNames) { if (res == null)
/** * Performs an operation with transaction with retries. * * @param cache Cache to do the transaction on. * @param clo Closure. * @return Result of closure execution. * @throws IgniteCheckedException If failed. */ public static <T> T doInTransactionWithRetries(IgniteInternalCache cache, IgniteOutClosureX<T> clo) throws IgniteCheckedException { assert cache != null; int attempts = 0; while (attempts < MAX_CACHE_TX_RETRIES) { try (Transaction tx = cache.txStart(PESSIMISTIC, REPEATABLE_READ)) { T res = clo.applyx(); tx.commit(); return res; } catch (IgniteException | IgniteCheckedException e) { ClusterTopologyException cte = X.cause(e, ClusterTopologyException.class); if (cte != null) ((IgniteFutureImpl)cte.retryReadyFuture()).internalFuture().getUninterruptibly(); else throw U.cast(e); } attempts++; } throw new IgniteCheckedException("Failed to perform operation since max number of attempts " + "exceeded. [maxAttempts=" + MAX_CACHE_TX_RETRIES + ']'); }
writeServiceToCache(res, cfgsCp.get(0)); else if (cfgsCp.size() > 1) { try (Transaction tx = serviceCache().txStart(PESSIMISTIC, READ_COMMITTED)) { for (ServiceConfiguration cfg : cfgsCp) { try {
/** {@inheritDoc} */ @Override public Transaction txStart(TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, int txSize) { CacheOperationContext prev = gate.enter(opCtx); try { return delegate.txStart(concurrency, isolation, timeout, txSize); } finally { gate.leave(prev); } }
/** {@inheritDoc} */ @Override public Transaction txStart(TransactionConcurrency concurrency, TransactionIsolation isolation) { CacheOperationContext prev = gate.enter(opCtx); try { return delegate.txStart(concurrency, isolation); } finally { gate.leave(prev); } }
try (Transaction tx = serviceCache().txStart(PESSIMISTIC, READ_COMMITTED)) { for (String name : svcNames) { if (res == null)
try (Transaction tx = cache.txStart(PESSIMISTIC, REPEATABLE_READ)) { T res = clo.applyx();
writeServiceToCache(res, cfgsCp.get(0)); else if (cfgsCp.size() > 1) { try (Transaction tx = serviceCache().txStart(PESSIMISTIC, READ_COMMITTED)) { for (ServiceConfiguration cfg : cfgsCp) { try {