You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2011/07/28 15:48:24 UTC

svn commit: r1151846 - in /incubator/jena/Experimental/TxTDB/trunk: src-dev/tx/ src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ src/main/java/com/hp/hpl/jena/tdb/index/bplustree/ src/main/java/com/hp/hpl/jena/tdb/nodetable/ src/main/java/com/hp/hpl/...

Author: andy
Date: Thu Jul 28 13:48:20 2011
New Revision: 1151846

URL: http://svn.apache.org/viewvc?rev=1151846&view=rev
Log:
Tests and fixes for wite transactions over commited-but-blocked write transactions.

Added:
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTableLib.java   (with props)
    incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransDisk.java   (with props)
    incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransMem.java   (contents, props changed)
      - copied, changed from r1151751, incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTrans.java
Removed:
    incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTrans.java
Modified:
    incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java
    incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFile.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFileStorage.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPlusTree.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTable.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTableNative.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/sys/SetupTDB.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java
    incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java
    incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestNodeTableTrans.java
    incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestTransSeq.java
    incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TS_Transaction.java
    incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialDisk.java
    incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialMem.java

Modified: incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/DevTx.java Thu Jul 28 13:48:20 2011
@@ -36,6 +36,11 @@ public class DevTx
     //   Better to also wrap reading from the parser?
     //   WriteLock => start xAction.
     
+    // TranasactionManager
+    //   When looking for delayed replays, we could note the generation the
+    //   activeReaders/activeWriters were working with and partially reduce
+    //   the waiting queue (up to one outstanding commit?)
+    
     // DSG.add(Quad(tripleInQuad, triple)) does not affect default graph.
     
     // * Check syncs NodeTupleTable, NodeTable keep a dirty flag 

Modified: incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src-dev/tx/TxMain.java Thu Jul 28 13:48:20 2011
@@ -37,6 +37,8 @@ import com.hp.hpl.jena.tdb.base.record.R
 import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
 import com.hp.hpl.jena.tdb.setup.DatasetBuilderStd ;
 import com.hp.hpl.jena.tdb.store.DatasetGraphTDB ;
+import com.hp.hpl.jena.tdb.transaction.TestTransSequentialDisk ;
+import com.hp.hpl.jena.tdb.transaction.TestTransSequentialMem ;
 import com.hp.hpl.jena.update.UpdateAction ;
 import com.hp.hpl.jena.update.UpdateFactory ;
 import com.hp.hpl.jena.update.UpdateRequest ;
@@ -65,6 +67,12 @@ public class TxMain
     {
         // and one in-mem sConn DB
         
+        TestTransSequentialDisk test = new TestTransSequentialDisk() ;
+        test.before() ;
+        test.trans_readBlock_03() ;
+        test.after() ;
+        exit(0) ;
+        
         initFS() ;
         
         String DATA = "/home/afs/Datasets/MusicBrainz/tracks.nt.gz" ;

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFile.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFile.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFile.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFile.java Thu Jul 28 13:48:20 2011
@@ -25,7 +25,7 @@ public interface ObjectFile extends Sync
 {
     public static final String type = "object" ;
     
-    /** A label to identify this ObjectFile - liek toString, except it must be implemented */ 
+    /** A label to identify this ObjectFile - like toString, except it must be implemented */ 
     public String getLabel() ;
     
     /** Allocate space for a write - pass this buffer to completeWrite */ 

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFileStorage.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFileStorage.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFileStorage.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFileStorage.java Thu Jul 28 13:48:20 2011
@@ -223,7 +223,7 @@ public class ObjectFileStorage implement
         if ( loc >= filesize )
         {
             if ( loc >= filesize+writeBuffer.position() )
-                throw new IllegalArgumentException("ObjectFile.read: Bad read: "+loc) ;
+                throw new IllegalArgumentException("ObjectFile.read: Bad read: location="+loc+" >= max="+(filesize+writeBuffer.position())) ;
             
             int x = writeBuffer.position() ;
             int y = writeBuffer.limit() ;
@@ -244,7 +244,7 @@ public class ObjectFileStorage implement
         lengthBuffer.clear() ;
         int x = file.read(lengthBuffer, loc) ;
         if ( x != 4 )
-            throw new FileException("ObjectFile.read("+loc+")["+filesize+"]: Failed to read the length : got "+x+" bytes") ;
+            throw new FileException("ObjectFile.read("+loc+")["+filesize+"]["+file.size()+"]: Failed to read the length : got "+x+" bytes") ;
         int len = lengthBuffer.getInt(0) ;
         ByteBuffer bb = ByteBuffer.allocate(len) ;
         x = file.read(bb, loc+SizeOfInt) ;

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPlusTree.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPlusTree.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPlusTree.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/index/bplustree/BPlusTree.java Thu Jul 28 13:48:20 2011
@@ -222,22 +222,6 @@ public class BPlusTree implements Iterab
         // No caching here.
         root = nodeManager.getRoot(rootIdx) ;
         return root ;
-        
-//        // Do we cache it or not?
-//        // Need to set read/write on every operation.
-//        if ( root == null )
-//        {
-//            rootIdx = 0 ;
-//            //--nodeManager.startRead() ;
-//            // Get, readable.
-//            root = nodeManager.getRoot(rootIdx) ;
-//            rootIdx = root.getId() ;
-//            // Build root node.
-//            // Per session count only.
-//            //--nodeManager.finishRead() ;
-//        }
-//        //BPTreeNode root2 = nodeManager.getRoot(rootIdx) ;
-//        return root ;
     }
 
     private void releaseRoot(BPTreeNode rootNode)

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTable.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTable.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTable.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTable.java Thu Jul 28 13:48:20 2011
@@ -37,7 +37,6 @@ public interface NodeTable extends Sync,
     
     /** The offset needed to predicate allocation difference between peristent tables - internal function */  
     public NodeId allocOffset() ; 
-    
 }
 
 /*

Added: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTableLib.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTableLib.java?rev=1151846&view=auto
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTableLib.java (added)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTableLib.java Thu Jul 28 13:48:20 2011
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.hp.hpl.jena.tdb.nodetable;
+
+import java.util.Iterator ;
+
+import org.openjena.atlas.lib.Pair ;
+
+import com.hp.hpl.jena.graph.Node ;
+import com.hp.hpl.jena.tdb.store.NodeId ;
+
+public class NodeTableLib
+{
+    public static void print(String label, NodeTable nodeTable)
+    {
+        if ( label != null )
+            System.out.println(label) ;
+        Iterator<Pair<NodeId, Node>> iter = nodeTable.all() ;
+        for ( ; iter.hasNext() ; )
+        {
+            Pair<NodeId, Node> x = iter.next() ;
+            NodeId nodeId = x.getLeft() ;
+            Node node = x.getRight() ;
+            System.out.println(nodeId+" "+node) ;
+        }
+    }
+}
+

Propchange: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTableLib.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTableNative.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTableNative.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTableNative.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/nodetable/NodeTableNative.java Thu Jul 28 13:48:20 2011
@@ -78,6 +78,9 @@ public class NodeTableNative implements 
     // NodeId to Node worker.
     private synchronized Node _retrieveNodeByNodeId(NodeId id)
     {
+        if ( id.getId() >= getObjects().length() )
+            return null ;
+        
         if ( NodeId.doesNotExist(id) )
             return null ;
         if ( NodeId.isAny(id) )

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/sys/SetupTDB.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/sys/SetupTDB.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/sys/SetupTDB.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/sys/SetupTDB.java Thu Jul 28 13:48:20 2011
@@ -64,6 +64,8 @@ import com.hp.hpl.jena.tdb.store.TripleT
 
 /** Makes things: datasets from locations, indexes */
 
+// Future - this become a colection of tstaics making things in standard ways. Does not build adataset. 
+
 public class SetupTDB
 {
     //private static final Logger log = LoggerFactory.getLogger(NewSetup.class) ;
@@ -559,6 +561,14 @@ public class SetupTDB
     }
     
     /** Make a NodeTable with cache and inline wrappers */ 
+    public static NodeTable makeNodeTable(Location location)
+    {
+        return makeNodeTable(location,
+                             Names.indexNode2Id, SystemTDB.Node2NodeIdCacheSize,
+                             Names.indexId2Node, SystemTDB.NodeId2NodeCacheSize) ;
+    }
+    
+    /** Make a NodeTable with cache and inline wrappers */ 
     public static NodeTable makeNodeTable(Location location,
                                           String indexNode2Id, int nodeToIdCacheSize,
                                           String indexId2Node, int idToNodeCacheSize)

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/DatasetBuilderTxn.java Thu Jul 28 13:48:20 2011
@@ -117,7 +117,7 @@ public class DatasetBuilderTxn
             else
                 objectFile = FileFactory.createObjectFileDisk(objFilename) ;
 
-            NodeTableTrans ntt = new NodeTableTrans(ntBase, idx, objectFile) ;
+            NodeTableTrans ntt = new NodeTableTrans(fsObjectFile.getBasename(), ntBase, idx, objectFile) ;
             txn.add(ntt) ;
             
             // Add inline wrapper.

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/JournalControl.java Thu Jul 28 13:48:20 2011
@@ -213,7 +213,7 @@ public class JournalControl
         {
             syslog.info("Recovering node data: "+fileRef.getFilename()) ;
             ObjectFile dataJrnl = FileFactory.createObjectFileDisk(objFilename) ;
-            NodeTableTrans ntt = new NodeTableTrans(baseNodeTable, new IndexMap(recordFactory), dataJrnl) ;
+            NodeTableTrans ntt = new NodeTableTrans(objFilename, baseNodeTable, new IndexMap(recordFactory), dataJrnl) ;
             ntt.append() ;
             ntt.close() ;
             baseNodeTable.sync() ;
@@ -262,6 +262,7 @@ public class JournalControl
                 
                 BlockMgr blkMgr = mgrs.get(e.getFileRef()) ;
                 Block blk = e.getBlock() ;
+                log.debug("Replay: {} {}",e.getFileRef(), blk) ;
                 blk.setModified(true) ;
                 blkMgr.overwrite(blk) ; 
                 

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/NodeTableTrans.java Thu Jul 28 13:48:20 2011
@@ -22,6 +22,8 @@ import java.util.Iterator ;
 
 import org.openjena.atlas.iterator.Iter ;
 import org.openjena.atlas.lib.Pair ;
+import org.slf4j.Logger ;
+import org.slf4j.LoggerFactory ;
 
 import com.hp.hpl.jena.graph.Node ;
 import com.hp.hpl.jena.tdb.TDBException ;
@@ -34,24 +36,25 @@ import com.hp.hpl.jena.tdb.store.NodeId 
 
 public class NodeTableTrans implements NodeTable, Transactional
 {
+    private static Logger log = LoggerFactory.getLogger(NodeTableTrans.class) ;
+    // TODO flag to note is any work is needed on commit.
     private final NodeTable base ;
     private long offset ;
     
-    private NodeTable nodeTableJournal ;
+    private NodeTable nodeTableJournal = null ;
     private static int CacheSize = 10000 ;      // [TxTDB:TODO] Make configurable 
     private boolean passthrough = false ;
-    private boolean inTransaction = false ;
     
     private final Index nodeIndex ;
     private final ObjectFile journal ;
+    private final String label ;
     
-    public NodeTableTrans(NodeTable sub, Index nodeIndex, ObjectFile journal)
+    public NodeTableTrans(String label, NodeTable sub, Index nodeIndex, ObjectFile journal)
     {
         this.base = sub ;
         this.nodeIndex = nodeIndex ;
         this.journal = journal ;
-        nodeTableJournal = new NodeTableNative(nodeIndex, journal) ;
-        nodeTableJournal = NodeTableCache.create(nodeTableJournal, CacheSize, CacheSize) ;
+        this.label = label ; 
     }
 
     public void setPassthrough(boolean v)   { passthrough = v ; }
@@ -117,20 +120,16 @@ public class NodeTableTrans implements N
     public void begin(Transaction txn)
     {
         passthrough = false ;
-        inTransaction = true ;
-        offset = (int)base.allocOffset().getId() ;
-        // Fast-ish clearing of the file.
-        nodeIndex.clear() ;
-        journal.reposition(0) ;
+        
+        offset = base.allocOffset().getId() ;
+        // Any outstanding transactions
+        int offset2 = (int)journal.length() ;
+        debug("begin: %s", label) ;
+        offset += offset2 ;
         
         this.nodeTableJournal = new NodeTableNative(nodeIndex, journal) ;
         this.nodeTableJournal = NodeTableCache.create(nodeTableJournal, CacheSize, CacheSize) ;
         // Do not add the inline NodeTable here - don't convert it's values by the offset!  
-
-        
-        // Setup.
-//        journal.position(0) ;
-//        this.otherAllocOffset = journal.length() ;
     }
     
     /** Copy from the journal file to the real file */
@@ -152,41 +151,54 @@ public class NodeTableTrans implements N
     @Override
     public void commitPrepare(Transaction txn)
     {
-        if ( ! inTransaction )
+        debug("commitPrepare: %s", label) ;
+        // The node table is append-only so it can be written during prepare.
+        // It does not need to wait for "enact".
+        if ( nodeTableJournal == null )
             throw new TDBTransactionException("Not in a transaction for a commit to happen") ;
-        journal.sync() ;
+        writeNodeJournal() ;
     }
     
     @Override
     public void commitEnact(Transaction txn)
     {
+        debug("commitEnact: %s", label) ;
+        //writeJournal() ;
+
+    }
+
+    private void writeNodeJournal()
+    {
         append() ;
-        base.sync() ;   // NodeTables should do an actual sync only if they have changed.
-        journal.reposition(0) ;
+        nodeIndex.clear() ;
+        journal.truncate(0) ;
+        journal.sync() ;
+        base.sync() ;
+        offset = base.allocOffset().getId() ;
+        passthrough = true ;
     }
 
     @Override
     public void commitClearup(Transaction txn)
     {
-        journal.truncate(0);
-        passthrough = true ;
+        debug("commitClearup") ;
+        finish() ;
     }
 
     @Override
     public void abort(Transaction txn)
     {
-        journal.reposition(0) ;
+        if ( nodeTableJournal == null )
+            throw new TDBTransactionException("Not in a transaction for a commit to happen") ;
+        finish() ;
     }
     
-//    private void clearUp()
-//    {
-//        passthrough = true ;
-//        //nodeIndex ;
-//        journal.truncate(0) ;
-//        journal.close() ;
-//        nodeTableJournal = null ;
-//    }
-//    
+    private void finish()
+    {
+        passthrough = true ;
+        nodeTableJournal = null ;
+   }
+
     @Override
     public Iterator<Pair<NodeId, Node>> all()
     {
@@ -202,5 +214,16 @@ public class NodeTableTrans implements N
     public void close()
     {}
 
+    @Override
+    public String toString() { return "NodeTableTrans:"+label ; }
+    
+    private void debug(String fmt, Object... args)
+    {
+        if ( log.isDebugEnabled() )
+        {
+            String x = String.format(fmt, args) ;
+            log.debug(x) ;
+        }
+    }
 }
 

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/Transaction.java Thu Jul 28 13:48:20 2011
@@ -94,12 +94,6 @@ public class Transaction
             x.commitPrepare(this) ;
     }
 
-    /** For testing - do things but do not write the commit record */
-    public void semiCommit()
-    {
-        prepare() ;
-    }
-    
     synchronized
     public void abort()
     { 

Modified: incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java Thu Jul 28 13:48:20 2011
@@ -165,12 +165,12 @@ public class TransactionManager
             case WRITE:
                 if ( activeReaders == 0 )
                     // Can commit imemdiately.
-                    commitTransaction(transaction) ;
+                    enactTransaction(transaction) ;
                 else
                 {
                     // Can't make permanent at the moment.
                     commitedAwaitingFlush.add(transaction) ;
-                    log.debug("Commit flush: "+transaction.getLabel()); 
+                    log("Queue commit flush", transaction) ; 
                     //if ( log.isDebugEnabled() )
                     //    log.debug("Commit blocked at the moment") ;
                     queue.add(transaction) ;
@@ -179,7 +179,8 @@ public class TransactionManager
         }
     }
 
-    private void commitTransaction(Transaction transaction)
+    /** The stage in a commit after commiting - make the changes permanent in the base data */ 
+    private void enactTransaction(Transaction transaction)
     {
         // Really, really do it!
         Iterator<Transactional> iter = transaction.components() ;
@@ -217,12 +218,15 @@ public class TransactionManager
     /** READ specific final actions. */
     private void endOfRead(Transaction transaction)
     {
-        processDelayedReplyQueue(transaction) ;
+        processDelayedReplayQueue(transaction) ;
         finishedReads ++ ;
     }
     
-    private void processDelayedReplyQueue(Transaction txn)
+    private void processDelayedReplayQueue(Transaction txn)
     {
+        // Sync'ed by notifyCommit.
+        // If we knew which version of the DB each was looking at, we could reduce more often here.
+        // [TxTDB:TODO]
         if ( activeReaders != 0 || activeWriters != 0 )
         {
             if ( queue.size() > 0 )
@@ -238,7 +242,9 @@ public class TransactionManager
                     continue ;
                 log("Flush delayed commit", txn2) ;
                 // This takes a Write lock on the  DSG - this is where it blocks.
-                JournalControl.replay(txn2) ;
+                // **** REPLAYS WHOLE JOURNAL
+                // **** Related NodeFileTrans: writes at "prepare" 
+                enactTransaction(txn2) ;
                 commitedAwaitingFlush.remove(txn2) ;
             } catch (InterruptedException ex)
             { Log.fatal(this, "Interruped!", ex) ; }

Modified: incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestNodeTableTrans.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestNodeTableTrans.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestNodeTableTrans.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestNodeTableTrans.java Thu Jul 28 13:48:20 2011
@@ -18,23 +18,47 @@
 
 package com.hp.hpl.jena.tdb.transaction;
 
+import static com.hp.hpl.jena.tdb.ReadWrite.WRITE ;
 import org.junit.Test ;
 import org.openjena.atlas.junit.BaseTest ;
 
 import com.hp.hpl.jena.graph.Node ;
 import com.hp.hpl.jena.sparql.util.NodeFactory ;
+import com.hp.hpl.jena.tdb.base.file.Location ;
+import com.hp.hpl.jena.tdb.base.objectfile.ObjectFile ;
+import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
+import com.hp.hpl.jena.tdb.index.Index ;
+import com.hp.hpl.jena.tdb.index.IndexMap ;
 import com.hp.hpl.jena.tdb.nodetable.NodeTable ;
 import com.hp.hpl.jena.tdb.store.NodeId ;
-import com.hp.hpl.jena.tdb.transaction.NodeTableTrans ;
-import com.hp.hpl.jena.tdb.transaction.Transaction ;
-import static com.hp.hpl.jena.tdb.ReadWrite.* ;
+import com.hp.hpl.jena.tdb.sys.SetupTDB ;
+import com.hp.hpl.jena.tdb.sys.SystemTDB ;
 
 public abstract class AbstractTestNodeTableTrans extends BaseTest
 {
-    abstract protected NodeTableTrans create(Node... nodes) ;
+    abstract protected ObjectFile createObjectFile() ;
+    abstract protected Location getLocation() ;
+    
+    private NodeTableTrans create(Node...nodes)
+    {
+        NodeTable base = SetupTDB.makeNodeTable(getLocation()) ;
+        for ( Node n : nodes )
+            base.getAllocateNodeId(n) ;
+        return create(base) ;
+    }
+    
+    private NodeTableTrans create(NodeTable base)
+    {
+        RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId) ;
+        Index idx = new IndexMap(recordFactory) ;
+        ObjectFile objectFile = createObjectFile() ;
+        NodeTableTrans ntt = new NodeTableTrans("test", base, idx, objectFile) ;
+        return ntt ;
+    }
     
     protected static Node node1 = NodeFactory.parseNode("<x>") ;
     protected static Node node2 = NodeFactory.parseNode("<y>") ;
+    protected static Node node3 = NodeFactory.parseNode("<z>") ;
 
     static void contains(NodeTable nt, Node...nodes)
     {
@@ -121,6 +145,150 @@ public abstract class AbstractTestNodeTa
         assertEquals(nodeId, nt0.getNodeIdForNode(node2)) ;
         ntt.commitClearup(txn) ;
     }
+    
+    // Tests 05 and 06 test reuse of a NodeTableTrans
+    // Tests 07 and 08 test creations of a NodeTableTrans where the first has "prepared" 
+    
+    @Test 
+    public void nodetrans_05()
+    {   
+        // 2 transactions - no blocking reader 
+        NodeTableTrans ntt = create(node1) ;
+        NodeId nodeId1 = ntt.getBaseNodeTable().getNodeIdForNode(node1) ;
+        
+        Transaction txn1 = createTxn(11) ; 
+        ntt.begin(txn1) ;
+        NodeId nodeId2 = ntt.getAllocateNodeId(node2) ;
+        ntt.commitPrepare(txn1) ;
+        ntt.commitEnact(txn1) ;
+        ntt.commitClearup(txn1) ;
+        
+        Transaction txn2 = createTxn(12) ; 
+        ntt.begin(txn2) ;
+        assertEquals(nodeId1, ntt.getNodeIdForNode(node1)) ;
+        assertEquals(nodeId2, ntt.getNodeIdForNode(node2)) ;
+        NodeId nodeId3 = ntt.getAllocateNodeId(node3) ;
+        assertEquals(nodeId3, ntt.getNodeIdForNode(node3)) ;
+        ntt.commitPrepare(txn2) ;
+        ntt.commitEnact(txn2) ;
+        ntt.commitClearup(txn2) ;
+
+        assertEquals(nodeId1, ntt.getBaseNodeTable().getNodeIdForNode(node1)) ;
+        assertEquals(nodeId2, ntt.getBaseNodeTable().getNodeIdForNode(node2)) ;
+        assertEquals(nodeId3, ntt.getBaseNodeTable().getNodeIdForNode(node3)) ;
+    }
+
+    @Test 
+    public void nodetrans_06()
+    {   
+        // 2 transactions - blocking reader 
+        NodeTableTrans ntt = create(node1) ;
+        NodeTable ntt0 = ntt.getBaseNodeTable() ; 
+        NodeId nodeId1 = ntt0.getNodeIdForNode(node1) ;
+        
+        Transaction txn1 = createTxn(11) ; 
+        ntt.begin(txn1) ;
+        NodeId nodeId2 = ntt.getAllocateNodeId(node2) ;
+        assertNotEquals(nodeId1, nodeId2) ;
+        ntt.commitPrepare(txn1) ;
+        
+        assertEquals(nodeId1, ntt0.getNodeIdForNode(node1)) ;
+        assertEquals(nodeId2, ntt0.getNodeIdForNode(node2)) ;
+        
+        // READ - don't enact
+        
+        Transaction txn2 = createTxn(12) ; 
+        ntt.begin(txn2) ;
+        assertEquals(nodeId1, ntt.getNodeIdForNode(node1)) ;
+        ntt.getNodeIdForNode(node2) ;
+        assertEquals(nodeId2, ntt.getNodeIdForNode(node2)) ;
+        
+        NodeId nodeId3 = ntt.getAllocateNodeId(node3) ;
+        assertEquals(nodeId3, ntt.getNodeIdForNode(node3)) ;
+        ntt.commitPrepare(txn2) ;
+
+        // READ ends.
+        
+        ntt.commitEnact(txn1) ;
+        ntt.commitClearup(txn1) ;
+        
+        ntt.commitEnact(txn2) ;
+        ntt.commitClearup(txn2) ;
+
+        assertEquals(nodeId1, ntt.getBaseNodeTable().getNodeIdForNode(node1)) ;
+        assertEquals(nodeId2, ntt.getBaseNodeTable().getNodeIdForNode(node2)) ;
+        assertEquals(nodeId3, ntt.getBaseNodeTable().getNodeIdForNode(node3)) ;
+    }
+    
+    @Test 
+    public void nodetrans_07()
+    {   
+        // 2 transactions - no blocking reader - create a second NodeTableTrans
+        NodeTableTrans ntt1 = create(node1) ;
+        NodeId nodeId1 = ntt1.getBaseNodeTable().getNodeIdForNode(node1) ;
+        
+        Transaction txn1 = createTxn(11) ; 
+        ntt1.begin(txn1) ;
+        NodeId nodeId2 = ntt1.getAllocateNodeId(node2) ;
+        ntt1.commitPrepare(txn1) ;
+        ntt1.commitEnact(txn1) ;
+        ntt1.commitClearup(txn1) ;
+        
+        NodeTableTrans ntt2 = create(ntt1.getBaseNodeTable()) ;
+        
+        Transaction txn2 = createTxn(12) ; 
+        ntt2.begin(txn2) ;
+        assertEquals(nodeId1, ntt2.getNodeIdForNode(node1)) ;
+        assertEquals(nodeId2, ntt2.getNodeIdForNode(node2)) ;
+        NodeId nodeId3 = ntt2.getAllocateNodeId(node3) ;
+        assertEquals(nodeId3, ntt2.getNodeIdForNode(node3)) ;
+        ntt2.commitPrepare(txn2) ;
+        ntt2.commitEnact(txn2) ;
+        ntt2.commitClearup(txn2) ;
+
+        assertEquals(nodeId1, ntt1.getBaseNodeTable().getNodeIdForNode(node1)) ;
+        assertEquals(nodeId2, ntt1.getBaseNodeTable().getNodeIdForNode(node2)) ;
+        assertEquals(nodeId3, ntt1.getBaseNodeTable().getNodeIdForNode(node3)) ;
+    }
+
+    @Test 
+    public void nodetrans_08()
+    {   
+        // 2 transactions - blocking reader - create a second NodeTableTrans
+        NodeTableTrans ntt1 = create(node1) ;
+        NodeId nodeId1 = ntt1.getBaseNodeTable().getNodeIdForNode(node1) ;
+        
+        Transaction txn1 = createTxn(11) ; 
+        ntt1.begin(txn1) ;
+        NodeId nodeId2 = ntt1.getAllocateNodeId(node2) ;
+        ntt1.commitPrepare(txn1) ;
+        
+        // READ - don't enact
+        
+        NodeTableTrans ntt2 = create(ntt1.getBaseNodeTable()) ;
+
+        Transaction txn2 = createTxn(12) ; 
+        ntt2.begin(txn2) ;
+        assertEquals(nodeId1, ntt2.getNodeIdForNode(node1)) ;
+        assertEquals(nodeId2, ntt2.getNodeIdForNode(node2)) ;
+        
+        NodeId nodeId3 = ntt2.getAllocateNodeId(node3) ;
+        assertEquals(nodeId3, ntt2.getNodeIdForNode(node3)) ;
+        ntt2.commitPrepare(txn2) ;
+
+        
+        // READ ends.
+        
+        ntt1.commitEnact(txn1) ;
+        ntt1.commitClearup(txn1) ;
+        
+        ntt2.commitEnact(txn2) ;
+        ntt2.commitClearup(txn2) ;
+
+        assertEquals(nodeId1, ntt1.getBaseNodeTable().getNodeIdForNode(node1)) ;
+        assertEquals(nodeId2, ntt1.getBaseNodeTable().getNodeIdForNode(node2)) ;
+        assertEquals(nodeId3, ntt1.getBaseNodeTable().getNodeIdForNode(node3)) ;
+    }
 
 }
 

Modified: incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestTransSeq.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestTransSeq.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestTransSeq.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestTransSeq.java Thu Jul 28 13:48:20 2011
@@ -28,6 +28,7 @@ import com.hp.hpl.jena.tdb.DatasetGraphT
 import com.hp.hpl.jena.tdb.ReadWrite ;
 import com.hp.hpl.jena.tdb.StoreConnection ;
 import com.hp.hpl.jena.tdb.TDBException ;
+import com.hp.hpl.jena.tdb.nodetable.NodeTable ;
 
 /** Basic tests and tests of ordering (single thread) */
 public abstract class AbstractTestTransSeq extends BaseTest
@@ -185,6 +186,9 @@ public abstract class AbstractTestTransS
         dsgR1.close() ;
 
         DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
+        
+        NodeTable nt = dsgR2.getQuadTable().getNodeTupleTable().getNodeTable() ;
+        
         assertTrue(dsgR2.contains(q1)) ;
         assertTrue(dsgR2.contains(q2)) ;
         dsgR2.close() ;

Modified: incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TS_Transaction.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TS_Transaction.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TS_Transaction.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TS_Transaction.java Thu Jul 28 13:48:20 2011
@@ -19,7 +19,8 @@ import org.junit.runners.Suite ;
     , TestTransIterator.class
     , TestObjectFileTransMem.class
     , TestObjectFileTransStorage.class
-    , TestNodeTableTrans.class
+    , TestNodeTableTransMem.class
+    , TestNodeTableTransDisk.class
     , TestTransSequentialMem.class
     , TestTransSequentialDisk.class
 })

Added: incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransDisk.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransDisk.java?rev=1151846&view=auto
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransDisk.java (added)
+++ incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransDisk.java Thu Jul 28 13:48:20 2011
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.hp.hpl.jena.tdb.transaction;
+
+import org.openjena.atlas.lib.FileOps ;
+
+import com.hp.hpl.jena.tdb.ConfigTest ;
+import com.hp.hpl.jena.tdb.base.file.FileSet ;
+import com.hp.hpl.jena.tdb.base.file.Location ;
+import com.hp.hpl.jena.tdb.base.objectfile.ObjectFile ;
+import com.hp.hpl.jena.tdb.sys.SetupTDB ;
+
+public class TestNodeTableTransDisk extends AbstractTestNodeTableTrans
+{
+    static Location loc = new Location(ConfigTest.getTestingDir()) ;
+    
+    @Override
+    protected ObjectFile createObjectFile()
+    {
+        FileOps.clearDirectory(loc.getDirectoryPath()) ;
+        FileSet fs = new FileSet(loc, "data") ;
+        return SetupTDB.makeObjectFile(fs) ;
+    }
+
+    @Override
+    protected Location getLocation()
+    {
+        return loc ;
+    }
+}
+

Propchange: incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransDisk.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransMem.java (from r1151751, incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTrans.java)
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransMem.java?p2=incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransMem.java&p1=incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTrans.java&r1=1151751&r2=1151846&rev=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTrans.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransMem.java Thu Jul 28 13:48:20 2011
@@ -18,35 +18,23 @@
 
 package com.hp.hpl.jena.tdb.transaction;
 
-import com.hp.hpl.jena.graph.Node ;
 import com.hp.hpl.jena.tdb.base.file.FileFactory ;
+import com.hp.hpl.jena.tdb.base.file.Location ;
 import com.hp.hpl.jena.tdb.base.objectfile.ObjectFile ;
-import com.hp.hpl.jena.tdb.base.objectfile.ObjectFileMem ;
-import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
-import com.hp.hpl.jena.tdb.index.Index ;
-import com.hp.hpl.jena.tdb.index.IndexMap ;
-import com.hp.hpl.jena.tdb.nodetable.NodeTable ;
-import com.hp.hpl.jena.tdb.nodetable.NodeTableNative ;
-import com.hp.hpl.jena.tdb.sys.SystemTDB ;
-import com.hp.hpl.jena.tdb.transaction.NodeTableTrans ;
 
-public class TestNodeTableTrans extends AbstractTestNodeTableTrans
+public class TestNodeTableTransMem extends AbstractTestNodeTableTrans
 {
-
     @Override
-    protected NodeTableTrans create(Node...nodes)
+    protected ObjectFile createObjectFile()
     {
-        RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId) ;
-        
-        NodeTable base = new NodeTableNative(new IndexMap(recordFactory), new ObjectFileMem()) ;
-        for ( Node n : nodes )
-            base.getAllocateNodeId(n) ;
+//        FileSet fs = new FileSet(getLocation(), "data") ;
+        return FileFactory.createObjectFileMem() ;
+    }
 
-        // Set up the transaction table.
-        Index idx = new IndexMap(recordFactory) ;
-        ObjectFile objectFile = FileFactory.createObjectFileMem() ;
-        NodeTableTrans ntt = new NodeTableTrans(base, idx, objectFile) ;
-        return ntt ;
+    @Override
+    protected Location getLocation()
+    {
+        return Location.mem() ;
     }
 }
 

Propchange: incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransMem.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialDisk.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialDisk.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialDisk.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialDisk.java Thu Jul 28 13:48:20 2011
@@ -32,13 +32,13 @@ public class TestTransSequentialDisk ext
     static final String DIR = ConfigTest.getTestingDirDB() ;
     static final Location LOC = new Location(DIR) ;
     
-    @Before public void setup()
+    @Before public void before()
     {
         FileOps.clearDirectory(DIR) ;
         StoreConnection.reset() ;
     }
 
-    @After public void teardown() {} 
+    @After public void after() {} 
 
     @Override
     protected StoreConnection getStoreConnection()

Modified: incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialMem.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialMem.java?rev=1151846&r1=1151845&r2=1151846&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialMem.java (original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialMem.java Thu Jul 28 13:48:20 2011
@@ -27,12 +27,12 @@ import com.hp.hpl.jena.tdb.base.file.Loc
 /** Basic tests and tests of ordering (single thread) */
 public class TestTransSequentialMem extends AbstractTestTransSeq
 {
-    @Before public void setup()
+    @Before public void before()
     {
         StoreConnection.reset() ;
     }
   
-    @After public void teardown() {}
+    @After public void after() {}
     
     @Override
     protected StoreConnection getStoreConnection()