jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [23/34] jena git commit: JENA-1089: Switch to using a fully transactional implementation.
Date Sat, 06 Feb 2016 15:51:12 GMT
JENA-1089: Switch to using a fully transactional implementation.

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

Branch: refs/heads/master
Commit: 77b4cf6821501fd4b052a93bbf2c5c4f387366b8
Parents: 59821df
Author: Andy Seaborne <andy@apache.org>
Authored: Fri Feb 5 11:28:04 2016 +0000
Committer: Andy Seaborne <andy@apache.org>
Committed: Fri Feb 5 19:17:33 2016 +0000

----------------------------------------------------------------------
 .../jdbc/mem/connections/TestDatasetConnection.java |  2 +-
 .../mem/metadata/TestDatasetConnectionMetadata.java | 16 ++++++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/77b4cf68/jena-jdbc/jena-jdbc-driver-mem/src/test/java/org/apache/jena/jdbc/mem/connections/TestDatasetConnection.java
----------------------------------------------------------------------
diff --git a/jena-jdbc/jena-jdbc-driver-mem/src/test/java/org/apache/jena/jdbc/mem/connections/TestDatasetConnection.java
b/jena-jdbc/jena-jdbc-driver-mem/src/test/java/org/apache/jena/jdbc/mem/connections/TestDatasetConnection.java
index 5bbab48..c5925ff 100644
--- a/jena-jdbc/jena-jdbc-driver-mem/src/test/java/org/apache/jena/jdbc/mem/connections/TestDatasetConnection.java
+++ b/jena-jdbc/jena-jdbc-driver-mem/src/test/java/org/apache/jena/jdbc/mem/connections/TestDatasetConnection.java
@@ -35,7 +35,7 @@ public class TestDatasetConnection extends AbstractJenaConnectionTests {
 
     @Override
     protected JenaConnection getConnection() throws SQLException {
-        return new MemConnection(DatasetFactory.createMem(), JenaConnection.DEFAULT_HOLDABILITY,
+        return new MemConnection(DatasetFactory.createTxnMem(), JenaConnection.DEFAULT_HOLDABILITY,
                 JenaConnection.DEFAULT_AUTO_COMMIT, JenaConnection.DEFAULT_ISOLATION_LEVEL,
JdbcCompatibility.DEFAULT);
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/77b4cf68/jena-jdbc/jena-jdbc-driver-mem/src/test/java/org/apache/jena/jdbc/mem/metadata/TestDatasetConnectionMetadata.java
----------------------------------------------------------------------
diff --git a/jena-jdbc/jena-jdbc-driver-mem/src/test/java/org/apache/jena/jdbc/mem/metadata/TestDatasetConnectionMetadata.java
b/jena-jdbc/jena-jdbc-driver-mem/src/test/java/org/apache/jena/jdbc/mem/metadata/TestDatasetConnectionMetadata.java
index c7bdcf7..fa83881 100644
--- a/jena-jdbc/jena-jdbc-driver-mem/src/test/java/org/apache/jena/jdbc/mem/metadata/TestDatasetConnectionMetadata.java
+++ b/jena-jdbc/jena-jdbc-driver-mem/src/test/java/org/apache/jena/jdbc/mem/metadata/TestDatasetConnectionMetadata.java
@@ -27,6 +27,7 @@ import org.apache.jena.jdbc.JdbcCompatibility;
 import org.apache.jena.jdbc.connections.JenaConnection;
 import org.apache.jena.jdbc.mem.connections.MemConnection;
 import org.apache.jena.jdbc.metadata.results.AbstractDatabaseMetadataTests;
+import org.apache.jena.query.Dataset ;
 import org.apache.jena.query.DatasetFactory ;
 
 /**
@@ -35,16 +36,27 @@ import org.apache.jena.query.DatasetFactory ;
  */
 public class TestDatasetConnectionMetadata extends AbstractDatabaseMetadataTests {
 
+    // Some datasets in memory don't provide perfect transactions but do report
+    // "supportsTransactions".
+    // createTxnMem is fully transactional. 
+    // "false" does not pass the tests because "supportsTransactions" is still true.
+    
+    boolean supportsSerializable = true ;
+    
     @Override
     protected JenaConnection getConnection() throws SQLException {
-        return new MemConnection(DatasetFactory.createMem(), JenaConnection.DEFAULT_HOLDABILITY,
-                JenaConnection.DEFAULT_AUTO_COMMIT, JenaConnection.DEFAULT_ISOLATION_LEVEL,
JdbcCompatibility.DEFAULT);
+        Dataset ds = supportsSerializable ? DatasetFactory.createTxnMem() : DatasetFactory.create()
;
+        int transactionLevelSupported = supportsSerializable ?  JenaConnection.TRANSACTION_SERIALIZABLE
:  JenaConnection.TRANSACTION_NONE ;
+        return new MemConnection(ds, JenaConnection.DEFAULT_HOLDABILITY,
+                JenaConnection.DEFAULT_AUTO_COMMIT, transactionLevelSupported, JdbcCompatibility.DEFAULT);
     }
 
     @Override
     protected List<Integer> getSupportedTransactionLevels() {
         List<Integer> levels = new ArrayList<Integer>();
         levels.add(Connection.TRANSACTION_NONE);
+        if ( supportsSerializable )
+            levels.add(Connection.TRANSACTION_SERIALIZABLE);
         return levels;
     }
 


Mime
View raw message