This is an automated email from the ASF dual-hosted git repository.

rvesse pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git


The following commit(s) were added to refs/heads/main by this push:
     new ee7f219  JENA-2079: Fix jena-jdbc-driver-tdb test warnings
     new a000d40  Merge pull request #968 from afs/jdbc-warnings
ee7f219 is described below

commit ee7f219b3e272e45b1dfff2398373f1c256613bf
Author: Andy Seaborne <[email protected]>
AuthorDate: Sat Mar 27 10:44:38 2021 +0000

    JENA-2079: Fix jena-jdbc-driver-tdb test warnings
---
 .../jena/jdbc/connections/AbstractJenaConnectionTests.java | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git 
a/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java
 
b/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java
index 0dd74cb..dc7ad4d 100644
--- 
a/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java
+++ 
b/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java
@@ -1094,7 +1094,7 @@ public abstract class AbstractJenaConnectionTests {
         Statement stmt = conn.createStatement();
         stmt.executeUpdate("INSERT DATA { <http://x> <http://y> <http://z> }");
 
-        // Make a subsequent read, with auto-commit we should see some data
+        // Make a subsequent read
         ResultSet rset = stmt.executeQuery("SELECT * WHERE { ?s ?p ?o }");
         Assert.assertNotNull(rset);
         Assert.assertFalse(rset.isClosed());
@@ -1109,7 +1109,7 @@ public abstract class AbstractJenaConnectionTests {
         // Commit the transaction
         conn.commit();
 
-        // Check we still can read the data
+        // Check we still can read the data (second transaction).
         rset = stmt.executeQuery("SELECT * WHERE { ?s ?p ?o }");
         Assert.assertNotNull(rset);
         Assert.assertFalse(rset.isClosed());
@@ -1121,6 +1121,9 @@ public abstract class AbstractJenaConnectionTests {
         rset.close();
         Assert.assertTrue(rset.isClosed());
 
+        // Commit the second transaction
+        conn.commit();
+
         // Close things
         stmt.close();
         Assert.assertTrue(stmt.isClosed());
@@ -1147,7 +1150,7 @@ public abstract class AbstractJenaConnectionTests {
         Statement stmt = conn.createStatement();
         stmt.executeUpdate("INSERT DATA { <http://x> <http://y> <http://z> }");
 
-        // Make a subsequent read, with auto-commit we should see some data
+        // Make a subsequent read
         ResultSet rset = stmt.executeQuery("SELECT * WHERE { ?s ?p ?o }");
         Assert.assertNotNull(rset);
         Assert.assertFalse(rset.isClosed());
@@ -1162,7 +1165,7 @@ public abstract class AbstractJenaConnectionTests {
         // Rollback the transaction
         conn.rollback();
 
-        // Check we can no longer read the data
+        // Check we can no longer read the data (second transaction)
         rset = stmt.executeQuery("SELECT * WHERE { ?s ?p ?o }");
         Assert.assertNotNull(rset);
         Assert.assertFalse(rset.isClosed());
@@ -1173,6 +1176,9 @@ public abstract class AbstractJenaConnectionTests {
         rset.close();
         Assert.assertTrue(rset.isClosed());
 
+        // Commit the second transaction
+        conn.commit();
+
         // Close things
         stmt.close();
         Assert.assertTrue(stmt.isClosed());

Reply via email to