@Override public void applyx(Transaction tx) throws Exception { tx.rollbackAsync().get(FUT_TIMEOUT); } },
@Override public Void call() throws Exception { spi.waitForBlocked(); final IgniteFuture<?> fut = txRef.get().rollbackAsync(); doSleep(500); spi.stopBlock(true); fut.get(); return null; } }, "tx-rollback-thread");
@Override public void applyx(Transaction tx) throws IgniteCheckedException { try { IgniteFuture<Void> rollbackFut = tx.rollbackAsync(); rollbackFut.listen(fut -> tx.close()); } catch (Throwable t) { log.error("Exception on async rollback", t); throw new IgniteCheckedException("Rollback failed", t); } } };
/** {@inheritDoc} */ @Override public long processInStreamOutLong(int type, BinaryRawReaderEx reader) throws IgniteCheckedException { long txId = reader.readLong(); IgniteFuture fut0; switch (type) { case OP_COMMIT_ASYNC: fut0 = tx(txId).commitAsync(); break; case OP_ROLLBACK_ASYNC: fut0 = tx(txId).rollbackAsync(); break; default: return super.processInStreamOutLong(type, reader); } // Future result is the tx itself, we do not want to return it to the platform. IgniteFuture fut = fut0.chain(new C1<IgniteFuture, Object>() { private static final long serialVersionUID = 0L; @Override public Object apply(IgniteFuture fut) { return null; } }); readAndListenFuture(reader, fut); return TRUE; }
tx.rollbackAsync().get(); break;
tx.rollbackAsync().get();
/** {@inheritDoc} */ @Override public long processInStreamOutLong(int type, BinaryRawReaderEx reader) throws IgniteCheckedException { long txId = reader.readLong(); IgniteFuture fut0; switch (type) { case OP_COMMIT_ASYNC: fut0 = tx(txId).commitAsync(); break; case OP_ROLLBACK_ASYNC: fut0 = tx(txId).rollbackAsync(); break; default: return super.processInStreamOutLong(type, reader); } // Future result is the tx itself, we do not want to return it to the platform. IgniteFuture fut = fut0.chain(new C1<IgniteFuture, Object>() { private static final long serialVersionUID = 0L; @Override public Object apply(IgniteFuture fut) { return null; } }); readAndListenFuture(reader, fut); return TRUE; }