jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sal...@apache.org
Subject svn commit: r1346193 - /jena/Experimental/jena-client/src/main/java/org/apache/jena/client/graph/DatasetGraphConnection.java
Date Mon, 04 Jun 2012 23:06:56 GMT
Author: sallen
Date: Mon Jun  4 23:06:56 2012
New Revision: 1346193

URL: http://svn.apache.org/viewvc?rev=1346193&view=rev
Log:
jena-client - Added transaction support to DatasetGraphs if they provide it.

Modified:
    jena/Experimental/jena-client/src/main/java/org/apache/jena/client/graph/DatasetGraphConnection.java

Modified: jena/Experimental/jena-client/src/main/java/org/apache/jena/client/graph/DatasetGraphConnection.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-client/src/main/java/org/apache/jena/client/graph/DatasetGraphConnection.java?rev=1346193&r1=1346192&r2=1346193&view=diff
==============================================================================
--- jena/Experimental/jena-client/src/main/java/org/apache/jena/client/graph/DatasetGraphConnection.java
(original)
+++ jena/Experimental/jena-client/src/main/java/org/apache/jena/client/graph/DatasetGraphConnection.java
Mon Jun  4 23:06:56 2012
@@ -9,6 +9,7 @@ import org.apache.jena.client.Updater;
 import com.hp.hpl.jena.query.Query;
 import com.hp.hpl.jena.query.ReadWrite;
 import com.hp.hpl.jena.sparql.core.DatasetGraph;
+import com.hp.hpl.jena.sparql.core.Transactional;
 import com.hp.hpl.jena.update.Update;
 
 public class DatasetGraphConnection extends ConnectionBase
@@ -25,7 +26,6 @@ public class DatasetGraphConnection exte
         
         this.repo = repo;
         this.dsg = dsg;
-        
     }
     
     @Override
@@ -77,38 +77,52 @@ public class DatasetGraphConnection exte
     @Override
     public boolean supportsTransactions()
     {
-        // We don't support transactions
-        return false;
+        return dsg instanceof Transactional;
     }
 
     @Override
     public void begin(ReadWrite readWrite)
     {
-        // We don't support transactions
+        if (supportsTransactions())
+        {
+            ((Transactional)dsg).begin(readWrite);
+        }
     }
 
     @Override
     public void commit()
     {
-        // We don't support transactions
+        if (supportsTransactions())
+        {
+            ((Transactional)dsg).commit();
+        }
     }
 
     @Override
     public void abort()
     {
-        // We don't support transactions
+        if (supportsTransactions())
+        {
+            ((Transactional)dsg).abort();
+        }
     }
     
     @Override
     public void end()
     {
-        // We don't support transactions
+        if (supportsTransactions())
+        {
+            ((Transactional)dsg).end();
+        }
     }
 
     @Override
     public boolean isInTransaction()
     {
-        // We don't support transactions
+        if (supportsTransactions())
+        {
+            return ((Transactional)dsg).isInTransaction();
+        }
         return false;
     }
     



Mime
View raw message