[ https://issues.apache.org/jira/browse/JENA-385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13559776#comment-13559776 ]
Hudson commented on JENA-385: ----------------------------- Integrated in Jena__Development_Test #409 (See [https://builds.apache.org/job/Jena__Development_Test/409/]) JENA-385 (Revision 1437026) Result = SUCCESS andy : Files : * /jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java > NPE during abort > ---------------- > > Key: JENA-385 > URL: https://issues.apache.org/jira/browse/JENA-385 > Project: Apache Jena > Issue Type: Bug > Components: TDB > Affects Versions: TDB 0.9.4 > Reporter: Simon Helsen > Assignee: Andy Seaborne > > we ran into a non-reproducible glitch where a transaction was unable to > commit (we don't know exactly why - could be a network glitch or hard drive > hickup). As a consequence, an abort was initiated which let to an NPE because > the journalObjfile was already null. It happens in the following code in > NodeTableTrans on the call to truncate. > public void abort(Transaction txn) > { > debug("abort") ; > if ( nodeTableJournal == null ) > throw new TDBTransactionException(txn.getLabel()+": Not in a > transaction for a commit to happen") ; > // Ensure the cache does not flush. > nodeTableJournal = null ; > // then make sure the journal file is empty. > journalObjFile.truncate(journalObjFileStartOffset) ; > journalObjFile.sync() ; > finish() ; > } > Should there not just be a check here to verify if journalObjFile != null? So > public void abort(Transaction txn) > { > debug("abort") ; > if ( nodeTableJournal == null ) > throw new TDBTransactionException(txn.getLabel()+": Not in a > transaction for a commit to happen") ; > // Ensure the cache does not flush. > nodeTableJournal = null ; > // then make sure the journal file is empty. > if (journalObjFile != null) { > journalObjFile.truncate(journalObjFileStartOffset) ; > journalObjFile.sync() ; > } > finish() ; > } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira