private void doPostTransactionActions() { LOGGER.debug("Beginning {} post transaction actions", _postTransactionActions.size()); for(int i = 0; i < _postTransactionActions.size(); i++) { _postTransactionActions.get(i).postCommit(); } LOGGER.debug("Completed post transaction actions"); }
public void commit() throws StoreException { LOGGER.debug("Performing commit for DtxBranch {}", _xid); if(_timeoutFuture != null) { LOGGER.debug("Attempting to cancel previous timeout task future for DtxBranch {}", _xid); boolean succeeded = _timeoutFuture.cancel(false); _timeoutFuture = null; LOGGER.debug("Cancelling previous timeout task {} for DtxBranch {}", (succeeded ? "succeeded" : "failed"), _xid); } if(_transaction == null) { prePrepareTransaction(); } else { _transaction.removeXid(_storedXidRecord); } _transaction.commitTran(); for(ServerTransaction.Action action : _postTransactionActions) { action.postCommit(); } _postTransactionActions.clear(); }
txn = null; postTransactionAction.postCommit(); postTransactionAction = null;
@Override public void dequeue(MessageEnqueueRecord record, Action postTransactionAction) { Transaction txn = null; try { if(record != null) { LOGGER.debug("Dequeue of message number {} from transaction log. Queue : {}", record.getMessageNumber(), record.getQueueId()); txn = _messageStore.newTransaction(); txn.dequeueMessage(record); txn.commitTran(); txn = null; } postTransactionAction.postCommit(); postTransactionAction = null; } finally { rollbackIfNecessary(postTransactionAction, txn); } }
private void addEnqueueFuture(final ListenableFuture<Void> future, final Action action, boolean persistent) { if(action != null) { // For persistent messages, do not synchronously invoke postCommit even if the future is completed. // Otherwise, postCommit (which actually does the enqueuing) might be called on successive messages out of order. if(future.isDone() && !persistent && !_strictOrderWithMixedDeliveryMode) { action.postCommit(); } else { _futureRecorder.recordFuture(future, action); } } }
private void addFuture(final ListenableFuture<Void> future, final Action action) { if(action != null) { if(future.isDone()) { action.postCommit(); } else { _futureRecorder.recordFuture(future, action); } } }
/** * Since AutoCommitTransaction have no concept of a long lived transaction, any Actions registered * by the caller are executed immediately. */ @Override public void addPostTransactionAction(final Action immediateAction) { immediateAction.postCommit(); }