/** * @param e Exception. * @param timedOut {@code True} if timed out. */ private boolean errorOrTimeoutOnTopologyVersion(IgniteCheckedException e, boolean timedOut) { if (e != null || timedOut) { // Can timeout only if tx is not null. assert e != null || tx != null : "Timeout is possible only in transaction"; onDone(e == null ? tx.timeoutException() : e); return true; } return false; }
/** * @param e Exception. * @param timedOut {@code True} if timed out. */ protected boolean errorOrTimeoutOnTopologyVersion(IgniteCheckedException e, boolean timedOut) { if (e != null || timedOut) { if (timedOut) e = tx.timeoutException(); ERR_UPD.compareAndSet(this, null, e); onDone(e); return true; } return false; }
err = tx.timedOut() ? tx.timeoutException() : tx.rollbackException();
return new GridFinishedFuture<>(timedOut() ? timeoutException() : rollbackException());
GridNearTxLocal tx0 = (GridNearTxLocal)tx; onError(tx0.timedOut() ? tx0.timeoutException() : tx0.rollbackException());
err = tx.timeoutException();
onDone(tx.timedOut() ? tx.timeoutException() : tx.rollbackException());
err = tx.timeoutException();
for (Object key : keys) { if (isRollbackOnly()) return new GridFinishedFuture<>(timedOut() ? timeoutException() : rollbackException());
onError(tx.timedOut() ? tx.timeoutException() : tx.rollbackException());
fut.onDone(this, timeoutException());
/** {@inheritDoc} */ @Override public void prepare() { if (!tx.state(PREPARING)) { if (tx.isRollbackOnly() || tx.setRollbackOnly()) { if (tx.remainingTime() == -1) onDone(tx.timeoutException()); else onDone(tx.rollbackException()); } else onDone(new IgniteCheckedException("Invalid transaction state for prepare " + "[state=" + tx.state() + ", tx=" + this + ']')); return; } try { tx.userPrepare(Collections.<IgniteTxEntry>emptyList()); cctx.mvcc().addFuture(this); preparePessimistic(); } catch (IgniteCheckedException e) { onDone(e); } }
return new GridFinishedFuture<>(timeoutException()); return new GridFinishedFuture<>(timeoutException());
if (tx.isRollbackOnly() || tx.setRollbackOnly()) { if (tx.remainingTime() == -1) onDone(tx.timeoutException()); else onDone(tx.rollbackException());
/** * Initializes future. * * @param remap Remap flag. */ @Override protected void prepare0(boolean remap, boolean topLocked) { boolean txStateCheck = remap ? tx.state() == PREPARING : tx.state(PREPARING); if (!txStateCheck) { if (tx.isRollbackOnly() || tx.setRollbackOnly()) { if (tx.timedOut()) onDone(null, tx.timeoutException()); else onDone(null, tx.rollbackException()); } else onDone(null, new IgniteCheckedException("Invalid transaction state for " + "prepare [state=" + tx.state() + ", tx=" + this + ']')); return; } boolean set = cctx.tm().setTxTopologyHint(tx.topologyVersionSnapshot()); try { prepare(tx.readEntries(), tx.writeEntries(), remap, topLocked); markInitialized(); } finally { if (set) cctx.tm().setTxTopologyHint(null); } }
return new GridFinishedFuture<>(timeoutException());
IgniteCheckedException err = tx.timeoutException();
GridDhtColocatedLockFuture.this.onDone(false, tx.timeoutException());
try { if (e != null || timedOut) onDone(timedOut ? tx.timeoutException() : e); else mapOnTopology();
throw isRollbackOnly() ? timedOut() ? timeoutException() : rollbackException() : new IgniteCheckedException("Invalid transaction state for commit [state=" + state() + ", tx=" + this + ']');