/** * @return {@code True} if should be committed after lock is acquired. */ protected boolean commitAfterLock() { return implicit() && (!dht() || colocated()); }
/** * Checks transaction expiration. * * @param checkTimeout Whether timeout should be checked. * @throws IgniteCheckedException If transaction check failed. */ protected void checkValid(boolean checkTimeout) throws IgniteCheckedException { if (local() && !dht() && remainingTime() == -1 && checkTimeout) state(MARKED_ROLLBACK, true); if (isRollbackOnly()) { if (remainingTime() == -1) throw new IgniteTxTimeoutCheckedException("Cache transaction timed out: " + CU.txString(this)); TransactionState state = state(); if (state == ROLLING_BACK || state == ROLLED_BACK) throw new IgniteTxRollbackCheckedException("Cache transaction is marked as rollback-only " + "(will be rolled back automatically): " + this); if (state == UNKNOWN) throw new IgniteTxHeuristicCheckedException("Cache transaction is in unknown state " + "(remote transactions will be invalidated): " + this); throw rollbackException(); } }
readThrough, /*event*/!invoke && !dht(), CU.subjectId(this, cctx), null,
/** * @return {@code True} if should be committed after lock is acquired. */ protected boolean commitAfterLock() { return implicit() && (!dht() || colocated()); }
/** * @param ver Mvcc version. */ public void markQueryEnlisted(MvccSnapshot ver) { if (!qryEnlisted) { assert ver != null || mvccSnapshot != null; if (mvccSnapshot == null) mvccSnapshot = ver; if(dht()) cctx.coordinators().registerLocalTransaction(mvccSnapshot.coordinatorVersion(), mvccSnapshot.counter()); qryEnlisted = true; } }
/** * Checks transaction expiration. * * @param checkTimeout Whether timeout should be checked. * @throws IgniteCheckedException If transaction check failed. */ protected void checkValid(boolean checkTimeout) throws IgniteCheckedException { if (local() && !dht() && remainingTime() == -1 && checkTimeout) state(MARKED_ROLLBACK, true); if (isRollbackOnly()) { if (remainingTime() == -1) throw new IgniteTxTimeoutCheckedException("Cache transaction timed out: " + CU.txString(this)); TransactionState state = state(); if (state == ROLLING_BACK || state == ROLLED_BACK) throw new IgniteTxRollbackCheckedException("Cache transaction is marked as rollback-only " + "(will be rolled back automatically): " + this); if (state == UNKNOWN) throw new IgniteTxHeuristicCheckedException("Cache transaction is in unknown state " + "(remote transactions will be invalidated): " + this); throw rollbackException(); } }
readThrough, /*event*/!invoke && !dht(), CU.subjectId(this, cctx), null,