@Override public void apply(IgniteInternalFuture<IgniteInternalTx> fut) { if (timedOut()) fut0.onDone(new IgniteTxTimeoutCheckedException("Failed to commit transaction, " + "transaction is concurrently rolled back on timeout: " + tx)); else fut0.onDone(new IgniteTxRollbackCheckedException("Failed to commit transaction, " + "transaction is concurrently rolled back: " + tx)); } });
return new GridFinishedFuture<>(timedOut() ? timeoutException() : rollbackException());
err = tx.timedOut() ? tx.timeoutException() : tx.rollbackException();
GridNearTxLocal tx0 = (GridNearTxLocal)tx; onError(tx0.timedOut() ? tx0.timeoutException() : tx0.rollbackException());
onDone(tx.timedOut() ? tx.timeoutException() : tx.rollbackException());
@Override public Map<K, V> apply(Void v, Exception e) { if (e != null) { setRollbackOnly(); throw new GridClosureException(e); } if (isRollbackOnly()) { if (timedOut()) throw new GridClosureException(new IgniteTxTimeoutCheckedException( "Transaction has been timed out: " + GridNearTxLocal.this)); else throw new GridClosureException(new IgniteTxRollbackCheckedException( "Transaction has been rolled back: " + GridNearTxLocal.this)); } return map; } },
for (Object key : keys) { if (isRollbackOnly()) return new GridFinishedFuture<>(timedOut() ? timeoutException() : rollbackException());
onError(tx.timedOut() ? tx.timeoutException() : 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); } }
throw timedOut() ? timeoutException() : rollbackException();
onDone(tx.timedOut() ? tx.timeoutException() : tx.rollbackException());
throw isRollbackOnly() ? timedOut() ? timeoutException() : rollbackException() : new IgniteCheckedException("Invalid transaction state for commit [state=" + state() + ", tx=" + this + ']');
@Override public void apply(IgniteInternalFuture<IgniteInternalTx> fut) { if (timedOut()) fut0.onDone(new IgniteTxTimeoutCheckedException("Failed to commit transaction, " + "transaction is concurrently rolled back on timeout: " + tx)); else fut0.onDone(new IgniteTxRollbackCheckedException("Failed to commit transaction, " + "transaction is concurrently rolled back: " + tx)); } });
GridNearTxLocal tx0 = (GridNearTxLocal)tx; onError(tx0.timedOut() ? tx0.timeoutException() : tx0.rollbackException());
onDone(tx.timedOut() ? tx.timeoutException() : tx.rollbackException());
@Override public Map<K, V> apply(Void v, Exception e) { if (e != null) { setRollbackOnly(); throw new GridClosureException(e); } if (isRollbackOnly()) { if (timedOut()) throw new GridClosureException(new IgniteTxTimeoutCheckedException( "Transaction has been timed out: " + GridNearTxLocal.this)); else throw new GridClosureException(new IgniteTxRollbackCheckedException( "Transaction has been rolled back: " + GridNearTxLocal.this)); } return map; } },
onError(tx.timedOut() ? tx.timeoutException() : 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); } }