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

Simon Helsen commented on JENA-385:
-----------------------------------

ok, well I agree the NPE is only a consequence. but why would the db be suspect 
at this point? This is the original problem (after which we attempted to abort)

Caused by: com.hp.hpl.jena.tdb.transaction.TDBTransactionException: Abort 
during prepare - transaction did not commit
        at 
com.hp.hpl.jena.tdb.transaction.Transaction.commit(Transaction.java:130)
        at 
com.hp.hpl.jena.tdb.transaction.DatasetGraphTxn.commit(DatasetGraphTxn.java:44)
        at 
com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction._commit(DatasetGraphTransaction.java:157)
        at 
com.hp.hpl.jena.sparql.core.DatasetGraphTrackActive.commit(DatasetGraphTrackActive.java:54)
        at com.hp.hpl.jena.sparql.core.DatasetImpl.commit(DatasetImpl.java:141)
        at 
com.ibm.team.jfs.rdf.internal.jena.tdb.JenaTxTdbProvider.storeWriteOperation(JenaTxTdbProvider.java:2322)
Caused by: com.hp.hpl.jena.tdb.base.file.FileException: FileBase.sync
        at com.hp.hpl.jena.tdb.base.file.FileBase.sync(FileBase.java:110)
        at 
com.hp.hpl.jena.tdb.base.file.BufferChannelFile.sync(BufferChannelFile.java:147)
        at 
com.hp.hpl.jena.tdb.base.objectfile.ObjectFileStorage.sync(ObjectFileStorage.java:379)
        at 
com.hp.hpl.jena.tdb.nodetable.NodeTableNative.sync(NodeTableNative.java:251)
        at 
com.hp.hpl.jena.tdb.nodetable.NodeTableCache.sync(NodeTableCache.java:219)
        at 
com.hp.hpl.jena.tdb.nodetable.NodeTableWrapper.sync(NodeTableWrapper.java:75)
        at 
com.hp.hpl.jena.tdb.transaction.NodeTableTrans.writeNodeJournal(NodeTableTrans.java:306)
        at 
com.hp.hpl.jena.tdb.transaction.NodeTableTrans.commitPrepare(NodeTableTrans.java:271)
        at 
com.hp.hpl.jena.tdb.transaction.Transaction.prepare(Transaction.java:185)
        at 
com.hp.hpl.jena.tdb.transaction.Transaction.commit(Transaction.java:115)
Caused by: java.nio.channels.ClosedChannelException
        at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:100)
        at sun.nio.ch.FileChannelImpl.force(FileChannelImpl.java:354)
        at com.hp.hpl.jena.tdb.base.file.FileBase.sync(FileBase.java:108)


                
> 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

Reply via email to