public void commitAsync(ExecutionCallback callback) { if (state != PREPARED) { throw new IllegalStateException("Transaction is not prepared"); } checkTimeout(); state = COMMITTING; transactionLog.commitAsync(nodeEngine, callback); // We should rethrow exception if transaction is not TWO_PHASE state = COMMITTED; }
public void commitAsync(ExecutionCallback callback) { if (state != PREPARED) { throw new IllegalStateException("Transaction is not prepared"); } checkTimeout(); state = COMMITTING; transactionLog.commitAsync(nodeEngine, callback); // We should rethrow exception if transaction is not TWO_PHASE state = COMMITTED; }
@Override public void commit() throws TransactionException, IllegalStateException { if (state != PREPARED) { throw new IllegalStateException("Transaction is not prepared"); } checkTimeout(); try { state = COMMITTING; List<Future> futures = transactionLog.commit(nodeEngine); // We should rethrow exception if transaction is not TWO_PHASE waitWithDeadline(futures, COMMIT_TIMEOUT_MINUTES, MINUTES, commitExceptionHandler); state = COMMITTED; } catch (Throwable e) { state = COMMIT_FAILED; throw ExceptionUtil.rethrow(e, TransactionException.class); } }
@Override public void commit() throws TransactionException, IllegalStateException { if (state != PREPARED) { throw new IllegalStateException("Transaction is not prepared"); } checkTimeout(); try { state = COMMITTING; List<Future> futures = transactionLog.commit(nodeEngine); // We should rethrow exception if transaction is not TWO_PHASE waitWithDeadline(futures, COMMIT_TIMEOUT_MINUTES, MINUTES, commitExceptionHandler); state = COMMITTED; } catch (Throwable e) { state = COMMIT_FAILED; throw ExceptionUtil.rethrow(e, TransactionException.class); } }
@Override public void prepare() throws TransactionException { if (state != ACTIVE) { throw new TransactionNotActiveException("Transaction is not active"); } checkTimeout(); try { state = PREPARING; List<Future> futures = transactionLog.prepare(nodeEngine); waitWithDeadline(futures, timeoutMillis, MILLISECONDS, RETHROW_TRANSACTION_EXCEPTION); futures.clear(); putTransactionInfoRemote(); state = PREPARED; } catch (Throwable e) { throw ExceptionUtil.rethrow(e, TransactionException.class); } }
@Override public void prepare() throws TransactionException { if (state != ACTIVE) { throw new TransactionNotActiveException("Transaction is not active"); } checkTimeout(); try { state = PREPARING; List<Future> futures = transactionLog.prepare(nodeEngine); waitWithDeadline(futures, timeoutMillis, MILLISECONDS, RETHROW_TRANSACTION_EXCEPTION); futures.clear(); putTransactionInfoRemote(); state = PREPARED; } catch (Throwable e) { throw ExceptionUtil.rethrow(e, TransactionException.class); } }