jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1239130 - in /incubator/jena/Jena2: ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/SystemARQ.java TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/TDB.java TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/migrate/DatasetGraphWithLock.java
Date Wed, 01 Feb 2012 13:49:23 GMT
Author: andy
Date: Wed Feb  1 13:49:23 2012
New Revision: 1239130

URL: http://svn.apache.org/viewvc?rev=1239130&view=rev
Log:
Sync the default graph (when not transactions).

Modified:
    incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/SystemARQ.java
    incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/TDB.java
    incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/migrate/DatasetGraphWithLock.java

Modified: incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/SystemARQ.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/SystemARQ.java?rev=1239130&r1=1239129&r2=1239130&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/SystemARQ.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/SystemARQ.java Wed
Feb  1 13:49:23 2012
@@ -62,6 +62,7 @@ public class SystemARQ
         }
         else
         {
+            sync(dataset.getDefaultGraph()) ;
             // Go through each graph.
             Iterator<Node> iter = Iter.iterator(dataset.listGraphNodes()) ;
             for ( ; iter.hasNext() ; )

Modified: incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/TDB.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/TDB.java?rev=1239130&r1=1239129&r2=1239130&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/TDB.java (original)
+++ incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/TDB.java Wed Feb  1 13:49:23
2012
@@ -156,7 +156,10 @@ public class TDB
             return ;
         }
         
+        // ARQ 2.7.1 and later - replace with SystenARQ.sync()
+
         // May be a general purpose dataset with TDB objects in it.
+        sync(dataset.getDefaultGraph()) ;
         Iterator<Node> iter = dataset.listGraphNodes() ;
         iter = Iter.toList(iter).iterator() ;   // Avoid iterator concurrency.
         for ( ; iter.hasNext() ; )

Modified: incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/migrate/DatasetGraphWithLock.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/migrate/DatasetGraphWithLock.java?rev=1239130&r1=1239129&r2=1239130&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/migrate/DatasetGraphWithLock.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/main/java/com/hp/hpl/jena/tdb/migrate/DatasetGraphWithLock.java
Wed Feb  1 13:49:23 2012
@@ -18,6 +18,8 @@
 
 package com.hp.hpl.jena.tdb.migrate;
 
+import org.openjena.atlas.lib.Sync ;
+
 import com.hp.hpl.jena.query.ReadWrite ;
 import com.hp.hpl.jena.shared.JenaException ;
 import com.hp.hpl.jena.sparql.SystemARQ ;
@@ -27,7 +29,7 @@ import com.hp.hpl.jena.sparql.core.Datas
  *  Only supports multiple-reader OR single-writer, and no transction abort.
  *  Transactions are not durable. 
  */
-public class DatasetGraphWithLock extends DatasetGraphTrackActive 
+public class DatasetGraphWithLock extends DatasetGraphTrackActive implements Sync
 {
     static class JenaLockException extends JenaException
     {
@@ -82,7 +84,7 @@ public class DatasetGraphWithLock extend
     protected void _commit()
     {
         if ( readWrite ==  ReadWrite.WRITE )
-            SystemARQ.sync(dsg) ;
+            sync() ;
         locked = false ;
         dsg.getLock().leaveCriticalSection() ;
     }
@@ -110,4 +112,14 @@ public class DatasetGraphWithLock extend
             dsg.close() ;
         dsg = null ;
     }
+
+    @Override
+    public void sync()
+    {
+        SystemARQ.sync(dsg) ;
+        // ARQ 2.7.0 bug - fails to sync the default graph.
+        // When moving to 2.7.1 or later, remove the code line below. 
+        // And these comments. 
+        SystemARQ.sync(dsg.getDefaultGraph()) ;
+    }
 }



Mime
View raw message