clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r1535544 - /clerezza/trunk/rdf.jena.tdb.storage/src/main/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetTcProvider.java
Date Thu, 24 Oct 2013 20:48:08 GMT
Author: reto
Date: Thu Oct 24 20:48:08 2013
New Revision: 1535544

URL: http://svn.apache.org/r1535544
Log:
CLEREZZA-831: added more locking

Modified:
    clerezza/trunk/rdf.jena.tdb.storage/src/main/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetTcProvider.java

Modified: clerezza/trunk/rdf.jena.tdb.storage/src/main/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetTcProvider.java
URL: http://svn.apache.org/viewvc/clerezza/trunk/rdf.jena.tdb.storage/src/main/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetTcProvider.java?rev=1535544&r1=1535543&r2=1535544&view=diff
==============================================================================
--- clerezza/trunk/rdf.jena.tdb.storage/src/main/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetTcProvider.java
(original)
+++ clerezza/trunk/rdf.jena.tdb.storage/src/main/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetTcProvider.java
Thu Oct 24 20:48:08 2013
@@ -462,7 +462,12 @@ public class SingleTdbDatasetTcProvider 
      */
     @Override
     public Set<UriRef> listGraphs() {
-        return new UriRefSet( graphNameIndex, Symbols.Graph );
+        datasetLock.readLock().lock();
+        try {
+            return new HashSet(new UriRefSet( graphNameIndex, Symbols.Graph ));
+        } finally {
+            datasetLock.readLock().unlock();
+        }
     }
 
     /*
@@ -471,7 +476,12 @@ public class SingleTdbDatasetTcProvider 
      */
     @Override
     public Set<UriRef> listMGraphs() {
-        return new UriRefSet( graphNameIndex, Symbols.MGraph );
+        datasetLock.readLock().lock();
+        try {
+            return  new HashSet(new UriRefSet( graphNameIndex, Symbols.MGraph ));
+        } finally {
+            datasetLock.readLock().unlock();
+        }
     }
 
     /*
@@ -480,7 +490,12 @@ public class SingleTdbDatasetTcProvider 
      */
     @Override
     public Set<UriRef> listTripleCollections() {
-        return new UriRefSet( graphNameIndex, null );
+        datasetLock.readLock().lock();
+        try {
+            return  new HashSet(new UriRefSet( graphNameIndex, null ));
+        } finally {
+            datasetLock.readLock().unlock();
+        }
     }
 
     /*



Mime
View raw message