/** * Cancellation has special meaning for lock futures. It's called then lock must be released on rollback. */ @Override public boolean cancel() { if (inTx()) onError(tx.rollbackException()); return onComplete(false, true); }
/** * Cancellation has special meaning for lock futures. It's called then lock must be released on rollback. */ @Override public boolean cancel() { if (inTx()) { onError(tx.rollbackException()); /** Should wait until {@link mappings} are ready before continuing with async rollback * or some primary nodes might not receive tx finish messages because of race. * If prepare phase has not started waiting is not necessary. */ synchronized (this) { while (!mappingsReady) try { wait(); } catch (InterruptedException e) { // Ignore interrupts. } } } return onComplete(false, true); }
err = tx.timedOut() ? tx.timeoutException() : tx.rollbackException();
return new GridFinishedFuture<>(timedOut() ? timeoutException() : rollbackException());
GridNearTxLocal tx0 = (GridNearTxLocal)tx; onError(tx0.timedOut() ? tx0.timeoutException() : tx0.rollbackException());
onDone(tx.timedOut() ? tx.timeoutException() : tx.rollbackException());
for (Object key : keys) { if (isRollbackOnly()) return new GridFinishedFuture<>(timedOut() ? timeoutException() : rollbackException());
onError(tx.timedOut() ? tx.timeoutException() : tx.rollbackException());
/** {@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<>(rollbackException());
return new GridFinishedFuture<>(rollbackException());
return new GridFinishedFuture<>(timedOut() ? timeoutException() : rollbackException()); return new GridFinishedFuture<>(timedOut() ? timeoutException() : rollbackException());
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<>(rollbackException());
return new GridFinishedFuture<>(rollbackException());
throw timedOut() ? timeoutException() : rollbackException();
onDone(tx.timedOut() ? tx.timeoutException() : tx.rollbackException());
return finishFuture(enlistFut, timedOut() ? timeoutException() : rollbackException(), false); return finishFuture(enlistFut, timedOut() ? timeoutException() : rollbackException(), false); return finishFuture(enlistFut, timedOut() ? timeoutException() : rollbackException(), false);
throw isRollbackOnly() ? timedOut() ? timeoutException() : rollbackException() : new IgniteCheckedException("Invalid transaction state for commit [state=" + state() + ", tx=" + this + ']');