/** * Commits the current transaction. This will: check for any conflicts, based on the change set aggregated from * all registered {@link TransactionAware} instances; flush any pending writes from the {@code TransactionAware}s; * commit the current transaction with the {@link TransactionSystemClient}; and clear the current transaction state. * * @throws TransactionConflictException if a conflict is detected with a recently committed transaction * @throws TransactionFailureException if an error occurs while committing */ public void finish() throws TransactionFailureException { Preconditions.checkState(currentTx != null, "Cannot finish tx that has not been started"); // each of these steps will abort and rollback the tx in case if errors, and throw an exception checkForConflicts(); persist(); commit(); postCommit(); currentTx = null; }
/** * Commits the current transaction. This will: check for any conflicts, based on the change set aggregated from * all registered {@link TransactionAware} instances; flush any pending writes from the {@code TransactionAware}s; * commit the current transaction with the {@link TransactionSystemClient}; and clear the current transaction state. * * @throws TransactionConflictException if a conflict is detected with a recently committed transaction * @throws TransactionFailureException if an error occurs while committing */ public void finish() throws TransactionFailureException { Preconditions.checkState(currentTx != null, "Cannot finish tx that has not been started"); // each of these steps will abort and rollback the tx in case if errors, and throw an exception checkForConflicts(); persist(); commit(); postCommit(); currentTx = null; }
persist(); try { currentTx = txClient.checkpoint(currentTx);
persist(); try { currentTx = txClient.checkpoint(currentTx);