afs commented on a change in pull request #537: JENA-1676 , JENA-1677: Make the commit step more robust against external factors URL: https://github.com/apache/jena/pull/537#discussion_r261577326
########## File path: jena-tdb/src/main/java/org/apache/jena/tdb/transaction/Transaction.java ########## @@ -205,158 +296,162 @@ public void abort() { synchronized (this) { switch (mode) { case READ : - state = TxnState.ABORTED ; - outcome = TxnOutcome.R_ABORTED ; - break ; + state = TxnState.ABORTED; + outcome = TxnOutcome.R_ABORTED; + break; case WRITE : if ( state != TxnState.ACTIVE ) - throw new TDBTransactionException("Transaction has already committed or aborted") ; - try { - forAllComponents(x->x.abort(this)) ; - } - catch (RuntimeException ex) { - if ( isIOException(ex) ) - SystemTDB.errlog.warn("IOException during 'abort' : " + ex.getMessage()) ; - else - SystemTDB.errlog.warn("Exception during 'abort'", ex) ; - // It's a bit of a mess! - throw new TDBTransactionException("Exception during abort - transaction did abort", ex) ; - } - state = TxnState.ABORTED ; - outcome = TxnOutcome.W_ABORTED ; - // journal.truncate to last commit - // Not need currently as the journal is only written in - // prepare. - break ; + throw new TDBTransactionException("Transaction has already committed or aborted"); + // Application abort. Didn't startwriing to the journal. Review comment: Fixed ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services