jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/2] jena git commit: Tidy up transactions
Date Sat, 10 Sep 2016 21:08:42 GMT
Repository: jena
Updated Branches:
  refs/heads/master 110628be7 -> 350082c3e


Tidy up transactions


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

Branch: refs/heads/master
Commit: 92dfa11122248bf21fb875f12856dd3c991511fd
Parents: 110628b
Author: Andy Seaborne <andy@apache.org>
Authored: Fri Sep 9 16:34:28 2016 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Fri Sep 9 16:34:28 2016 +0100

----------------------------------------------------------------------
 .../org/apache/jena/sdb/sql/SDBConnection.java  |  3 ++-
 .../jena/sdb/test/junit/QueryTestSDB.java       | 22 ++++++++------------
 2 files changed, 11 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/92dfa111/jena-sdb/src/main/java/org/apache/jena/sdb/sql/SDBConnection.java
----------------------------------------------------------------------
diff --git a/jena-sdb/src/main/java/org/apache/jena/sdb/sql/SDBConnection.java b/jena-sdb/src/main/java/org/apache/jena/sdb/sql/SDBConnection.java
index 006d586..3d217c8 100644
--- a/jena-sdb/src/main/java/org/apache/jena/sdb/sql/SDBConnection.java
+++ b/jena-sdb/src/main/java/org/apache/jena/sdb/sql/SDBConnection.java
@@ -137,6 +137,7 @@ public class SDBConnection
         { throw ex ; }
     }
 
+    @Deprecated
     public Object executeInTransaction(Command c) {
         return getTransactionHandler().executeInTransaction(c) ;
     }
@@ -145,7 +146,7 @@ public class SDBConnection
         getTransactionHandler().execute(action) ;
     }
 
-    public <T> T executeRtn(Supplier<T> action) {
+    public <T> T calculate(Supplier<T> action) {
         return getTransactionHandler().calculate(action) ;
     }
     

http://git-wip-us.apache.org/repos/asf/jena/blob/92dfa111/jena-sdb/src/test/java/org/apache/jena/sdb/test/junit/QueryTestSDB.java
----------------------------------------------------------------------
diff --git a/jena-sdb/src/test/java/org/apache/jena/sdb/test/junit/QueryTestSDB.java b/jena-sdb/src/test/java/org/apache/jena/sdb/test/junit/QueryTestSDB.java
index 73f8b82..7bdd621 100644
--- a/jena-sdb/src/test/java/org/apache/jena/sdb/test/junit/QueryTestSDB.java
+++ b/jena-sdb/src/test/java/org/apache/jena/sdb/test/junit/QueryTestSDB.java
@@ -28,7 +28,6 @@ import org.apache.jena.sdb.engine.QueryEngineSDB ;
 import org.apache.jena.sdb.sql.SDBConnection ;
 import org.apache.jena.sdb.store.DatasetStore ;
 import org.apache.jena.sdb.util.StoreUtils ;
-import org.apache.jena.shared.Command ;
 import org.apache.jena.sparql.SystemARQ ;
 import org.apache.jena.sparql.engine.QueryEngineFactory ;
 import org.apache.jena.sparql.engine.QueryExecutionBase ;
@@ -95,18 +94,15 @@ public class QueryTestSDB extends EarlTestCase
 
         // Truncate outside a transaction.
         store.getTableFormatter().truncate() ;
-        store.getConnection().executeInTransaction(new Command(){
-            @Override
-            public Object execute()
-            {
-                // Default graph
-                for ( String fn : filenamesDft )
-                    StoreUtils.load(store, fn) ;    
-                // Named graphs
-                for ( String fn : filenamesNamed )
-                    StoreUtils.load(store, fn, fn) ;    
-                return null ;
-            }}) ;
+        store.getConnection().execute(()->{
+            // Default graph
+            for ( String fn : filenamesDft )
+                StoreUtils.load(store, fn) ;    
+            // Named graphs
+            for ( String fn : filenamesNamed )
+                StoreUtils.load(store, fn, fn) ;    
+
+        }) ;
         lastDftLoaded = filenamesDft ;
         lastNamedLoaded = filenamesNamed ;
         


Mime
View raw message