You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2013/01/22 17:20:12 UTC

[jira] [Commented] (JENA-385) NPE during abort

    [ https://issues.apache.org/jira/browse/JENA-385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13559740#comment-13559740 ] 

Andy Seaborne commented on JENA-385:
------------------------------------

Added - but it will have little effect.  The assignment of null journalObjFile is at the end of the prepare step of commitThe commit call was made.

In essence, you have both commited and aborted the same transaction, whether it is because the commit failed for system reasons or a concurrent abort() call was made. he earlier problem is the propably root cause and the database is now suspect.

                
> 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
>
> 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