incubator-jena-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Seaborne <>
Subject Re: svn commit: r1157790 - /incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/
Date Tue, 16 Aug 2011 18:33:09 GMT

It is to do with closing ... in fact, being too neat and tidy on closing.

Nodes are written inside the transaction - the data goes to the 
NodeTableTrans journal file, which is an ObjectFileStorage.

nodeTableJournal.close() is going to call journal.close so whether 
nodeTableJournal.close or direct journal.close is called does not matter 

What does matter is that when ObjectFileStorage is gracefully closed, it 
flushes to disk.  ObjectFileStorage has a write buffer (dft 8K).

There is data in it from the transaction which is calling abort.  In a 
large transaction, the buffer may have flushed anyway.

Result: bytes are written to the journal on disk on abort or before.  Oops.

The design does allow for reuse of data journals (not used) so journals 
are not cleared at transaction start.

Solution: truncate the file before closing, no data written and any data 
already written is removed.

To allow for concatenated use of the file, the start point in journal on 
each transaction begin is recorded and on abort, the system truncates to 
that point.

2* TestTransSystem (mem and disk) running in the background as I type.


View raw message