Github user anew commented on a diff in the pull request:
https://github.com/apache/incubator-tephra/pull/47#discussion_r138436222
--- Diff:
tephra-core/src/main/java/org/apache/tephra/TransactionContext.java ---
@@ -311,25 +304,16 @@ private void persist() throws
TransactionFailureException {
}
private void commit() throws TransactionFailureException {
- boolean commitSuccess = false;
try {
- commitSuccess = txClient.commit(currentTx);
- } catch (TransactionNotInProgressException e) {
- String message = String.format("Transaction %d is not in progress.",
currentTx.getTransactionId());
- LOG.warn(message, e);
- abort(new TransactionFailureException(message, e));
- // abort will throw that exception
+ txClient.commitOrThrow(currentTx);
+ } catch (TransactionNotInProgressException |
TransactionConflictException e) {
--- End diff --
it does not make a difference, but may be more future-proof.
---