/** * Rollback and properly close transaction. * @param tx Transaction. * @throws IgniteCheckedException if failed. */ private void doRollback(@NotNull GridNearTxLocal tx) throws IgniteCheckedException { try { tx.rollback(); } finally { closeTx(tx); } }
/** * Commits active transaction if exists. * * @throws IgniteCheckedException If failed. */ private void finishActiveTxIfNecessary() throws IgniteCheckedException { try (GridNearTxLocal tx = MvccUtils.tx(ctx)) { if (tx == null) return; if (!tx.isRollbackOnly()) tx.commit(); else tx.rollback(); } }
@Override public Integer call() throws Exception { try ( GridNearTxLocal tx = CU.txStartInternal(ctx, cacheView, PESSIMISTIC, REPEATABLE_READ) ) { GridCacheSemaphoreState val = cacheView.get(key); if (val == null) throw new IgniteException("Failed to find semaphore with given name: " + name); int cnt = val.getCount(); tx.rollback(); return cnt; } } });
@Override public Sync call() throws Exception { try (GridNearTxLocal tx = CU.txStartInternal(ctx, cacheView, PESSIMISTIC, REPEATABLE_READ)) { GridCacheLockState val = cacheView.get(key); if (val == null) { if (log.isDebugEnabled()) log.debug("Failed to find reentrant lock with given name: " + name); return null; } tx.rollback(); return new Sync(val); } } });
if (!(e instanceof IgniteTxRollbackCheckedException)) { try { tx.rollback();
/** * Rollback and properly close transaction. * @param tx Transaction. * @throws IgniteCheckedException if failed. */ @SuppressWarnings("ThrowFromFinallyBlock") private void doRollback(@NotNull GridNearTxLocal tx) throws IgniteCheckedException { try { tx.rollback(); } finally { closeTx(tx); } }
/** * Commits active transaction if exists. * * @throws IgniteCheckedException If failed. */ private void finishActiveTxIfNecessary() throws IgniteCheckedException { try (GridNearTxLocal tx = MvccUtils.tx(ctx)) { if (tx == null) return; if (!tx.isRollbackOnly()) tx.commit(); else tx.rollback(); } }
@Override public Integer call() throws Exception { try ( GridNearTxLocal tx = CU.txStartInternal(ctx, cacheView, PESSIMISTIC, REPEATABLE_READ) ) { GridCacheSemaphoreState val = cacheView.get(key); if (val == null) throw new IgniteException("Failed to find semaphore with given name: " + name); int cnt = val.getCount(); tx.rollback(); return cnt; } } });
@Override public Sync call() throws Exception { try (GridNearTxLocal tx = CU.txStartInternal(ctx, cacheView, PESSIMISTIC, REPEATABLE_READ)) { GridCacheLockState val = cacheView.get(key); if (val == null) { if (log.isDebugEnabled()) log.debug("Failed to find reentrant lock with given name: " + name); return null; } tx.rollback(); return new Sync(val); } } });
if (!(e instanceof IgniteTxRollbackCheckedException)) { try { tx.rollback();