jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [22/34] jena git commit: JENA-1131: Use MRSW transaction policy.
Date Sat, 06 Feb 2016 15:51:11 GMT
JENA-1131: Use MRSW transaction policy.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/eb06cc31
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/eb06cc31
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/eb06cc31

Branch: refs/heads/master
Commit: eb06cc31e4edbac6a550b95ea7b18c4c80dfb500
Parents: cf0aa84
Author: Andy Seaborne <andy@apache.org>
Authored: Fri Feb 5 19:08:58 2016 +0000
Committer: Andy Seaborne <andy@apache.org>
Committed: Fri Feb 5 19:17:33 2016 +0000

----------------------------------------------------------------------
 .../org/apache/jena/sparql/core/DatasetGraphMap.java | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/eb06cc31/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphMap.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphMap.java b/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphMap.java
index 89474cd..50b07bf 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphMap.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/core/DatasetGraphMap.java
@@ -29,6 +29,7 @@ import org.apache.jena.atlas.iterator.IteratorConcat ;
 import org.apache.jena.graph.Graph ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.Triple ;
+import org.apache.jena.query.ReadWrite ;
 import org.apache.jena.sparql.ARQException ;
 import org.apache.jena.sparql.core.DatasetGraphFactory.GraphMaker ;
 
@@ -36,11 +37,10 @@ import org.apache.jena.sparql.core.DatasetGraphFactory.GraphMaker ;
  *  Subclasses need to manage any implicit graph creation.
  *  This implementation provides copy-in, copy-out for {@link #addGraph}  
  */
-public class DatasetGraphMap extends DatasetGraphTriplesQuads implements TransactionalNotSupported
+public class DatasetGraphMap extends DatasetGraphTriplesQuads
 {
     private final GraphMaker graphMaker ;
     private final Map<Node, Graph> graphs = new HashMap<>() ;
-
     private Graph defaultGraph ;
     
     public DatasetGraphMap() {
@@ -56,6 +56,17 @@ public class DatasetGraphMap extends DatasetGraphTriplesQuads implements
Transac
         this.graphMaker = graphMaker ;
     }
     
+    // ----
+    private final Transactional txn                     = new TransactionalMRSW() ;
+    @Override public void begin(ReadWrite mode)         { txn.begin(mode) ; }
+    @Override public void commit()                      { txn.commit() ; }
+    @Override public void abort()                       { txn.abort() ; }
+    @Override public boolean isInTransaction()          { return txn.isInTransaction() ;
}
+    @Override public void end()                         { txn.end(); }
+    @Override public boolean supportsTransactions()     { return true ; }
+    @Override public boolean supportsTransactionAbort() { return false ; }
+    // ----
+    
     @Override
     public Iterator<Node> listGraphNodes() {
         return graphs.keySet().iterator();


Mime
View raw message