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 2012/06/08 12:52:33 UTC

svn commit: r1348021 - /jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_Explore.java

Author: andy
Date: Fri Jun  8 10:52:33 2012
New Revision: 1348021

URL: http://svn.apache.org/viewvc?rev=1348021&view=rev
Log: (empty)

Modified:
    jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_Explore.java

Modified: jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_Explore.java
URL: http://svn.apache.org/viewvc/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_Explore.java?rev=1348021&r1=1348020&r2=1348021&view=diff
==============================================================================
--- jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_Explore.java (original)
+++ jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena250_Explore.java Fri Jun  8 10:52:33 2012
@@ -14,8 +14,10 @@ import com.hp.hpl.jena.rdf.model.Propert
 import com.hp.hpl.jena.rdf.model.Resource ;
 import com.hp.hpl.jena.tdb.StoreConnection ;
 import com.hp.hpl.jena.tdb.TDBFactory ;
+import com.hp.hpl.jena.tdb.base.block.FileMode ;
 import com.hp.hpl.jena.tdb.base.file.Location ;
 import com.hp.hpl.jena.tdb.sys.SystemTDB ;
+import com.hp.hpl.jena.tdb.sys.TestOps ;
 
 public class Jena250_Explore {
 
@@ -38,7 +40,10 @@ public class Jena250_Explore {
 		System.out.println("Starting TestStoreRelease");
 
 		// Not seen in mapped mode.
-		ARQ.getContext().set(SystemTDB.symFileMode, "direct");
+		//ARQ.getContext().set(SystemTDB.symFileMode, "direct");
+
+		TestOps.setFileMode(FileMode.direct) ;
+		
 		if (!SystemTDB.fileMode().toString().equals("direct")) {
 			throw new RuntimeException("file mode is not direct, but " + SystemTDB.fileMode()); //$NON-NLS-1$
 		}
@@ -61,31 +66,36 @@ public class Jena250_Explore {
 
 		Location location = new Location(DIR);
 
+		// Non-trans.
+        Dataset ds = TDBFactory.createDataset(location);
+        addTripleAction(ds) ;
+		
 		Jena250_Explore.oneCycle(location);
 		//System.exit(0) ;
+        System.out.println("Release") ;
 		StoreConnection.release(location);
 
 		Jena250_Explore.oneCycle(location);
-        //StoreConnection.release(location);
+        System.out.println("Release") ;
+        StoreConnection.release(location);
         
 		Jena250_Explore.oneCycle(location);
-        //StoreConnection.release(location);
+        System.out.println("Release") ;
+        StoreConnection.release(location);
 	}
 
 	public static void oneCycle(Location location) {
 	    //listFiles(DIR) ;
-		Dataset ds = TDBFactory.createDataset(location);
+        Dataset ds = TDBFactory.createDataset(location);
 		//listFiles(DIR) ;
-		addTriple(ds) ;
+		addTripleTrans(ds) ;
 		countAndPrint(ds) ;
-		System.out.println("Release") ;
 		//listFiles(DIR) ;
 		System.out.println() ;
 	}
 	
-	private static void addTriple(Dataset ds)
+	private static void addTripleAction(Dataset ds)
 	{
-	    ds.begin(WRITE) ;
         Model model = ds.getDefaultModel() ;
         
         Resource subject = model.createResource("http://example/s");
@@ -93,6 +103,13 @@ public class Jena250_Explore {
         model.add(subject, predicate, ""+System.currentTimeMillis());
         
         countInnerPrint(ds) ;
+	    
+	}
+	
+	private static void addTripleTrans(Dataset ds)
+	{
+	    ds.begin(WRITE) ;
+	    addTripleAction(ds) ;
         ds.commit() ;
         ds.end() ;
 	}