db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r1330482 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/UpdateLocksTest.java
Date Wed, 25 Apr 2012 18:46:19 GMT
Author: myrnavl
Date: Wed Apr 25 18:46:19 2012
New Revision: 1330482

URL: http://svn.apache.org/viewvc?rev=1330482&view=rev
Log:
DERBY-5667; testReadCommitted(org.apache.derbyTesting.functionTests.tests.store.UpdateLocksTest)junit.framework.AssertionFailedError:
Missing rows in ResultSet
  adjusting the test so every commit following a delete is followed in turn
   by a call to wait for post-commit threads to finish.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/UpdateLocksTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/UpdateLocksTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/UpdateLocksTest.java?rev=1330482&r1=1330481&r2=1330482&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/UpdateLocksTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/UpdateLocksTest.java
Wed Apr 25 18:46:19 2012
@@ -1219,6 +1219,8 @@ public class UpdateLocksTest extends Bas
                 )
             ));
         commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         commit();
@@ -2086,6 +2088,8 @@ public class UpdateLocksTest extends Bas
                 )
             ));
         commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
 
@@ -2378,6 +2382,8 @@ public class UpdateLocksTest extends Bas
                 )
             ));
         commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
 
@@ -2458,6 +2464,8 @@ public class UpdateLocksTest extends Bas
                     {_app, _ut, _t, "2", _IX, _A, _tl, _g, _a}}
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -2594,6 +2602,8 @@ public class UpdateLocksTest extends Bas
                 )
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -2631,6 +2641,8 @@ public class UpdateLocksTest extends Bas
                     {_app, _ut, _t, "2", _IX, _A, _tl, _g, _a}}
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -2822,6 +2834,8 @@ public class UpdateLocksTest extends Bas
                 )
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -2977,6 +2991,8 @@ public class UpdateLocksTest extends Bas
                 )
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -4490,6 +4506,8 @@ public class UpdateLocksTest extends Bas
                 )
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -5968,6 +5986,8 @@ public class UpdateLocksTest extends Bas
              )
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -6105,6 +6125,8 @@ public class UpdateLocksTest extends Bas
                 )
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -6542,6 +6564,8 @@ public class UpdateLocksTest extends Bas
                 )
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -6740,6 +6764,8 @@ public class UpdateLocksTest extends Bas
                     {_app, _ut, _r, "2", _X, _A, "(4,6)", _g, _a}}
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -6763,6 +6789,8 @@ public class UpdateLocksTest extends Bas
                 {"7", "70", pad2("seven", pad), pad2("index pad 7", idxPad)}});
 
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         /* ------------------------------------------------------------
          * Test full cursor scan which deletes "even" rows.
          * ------------------------------------------------------------
@@ -6771,7 +6799,6 @@ public class UpdateLocksTest extends Bas
             "delete from a where a = 2 or a = 4 or a = 6");
         ltrs = getLocks();
 
-        s.execute("call wait_for_post_commit()");
         JDBC.assertUnorderedResultSet(
             ltrs,
             isolation == Connection.TRANSACTION_SERIALIZABLE ?
@@ -6829,6 +6856,8 @@ public class UpdateLocksTest extends Bas
                     {_app, _ut, _r, "2", _X, _A, "(6,6)", _g, _a}}
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -6872,10 +6901,11 @@ public class UpdateLocksTest extends Bas
         s.executeUpdate(
             "delete from a where (a = 2 or a = 4 or a = 6) and (b < 8)");
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
-        s.execute("call wait_for_post_commit()");
         JDBC.assertUnorderedResultSet(
             s.executeQuery("select * from a"),
             unPadded ?
@@ -7137,7 +7167,6 @@ public class UpdateLocksTest extends Bas
             "delete from a  where a = 2");
         ltrs = getLocks();
 
-        s.execute("call wait_for_post_commit()");
         JDBC.assertUnorderedResultSet(
             ltrs,
             isolation == Connection.TRANSACTION_SERIALIZABLE ?
@@ -7177,6 +7206,8 @@ public class UpdateLocksTest extends Bas
                     {_app, _ut, _r, "1", _X, _A, "(2,6)", _g, _a}}
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         s.executeUpdate(
             "update a  set b = -b where a = 2");
         ltrs = getLocks();
@@ -7305,6 +7336,8 @@ public class UpdateLocksTest extends Bas
                     {_app, _ut, _r, "1", _X, _A, "(7,6)", _g, _a}}
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         JDBC.assertUnorderedResultSet(
@@ -7337,7 +7370,6 @@ public class UpdateLocksTest extends Bas
             "delete from a  where a = 1 or a = 7");
         ltrs = getLocks();
 
-        s.execute("call wait_for_post_commit()");
         JDBC.assertUnorderedResultSet(
             ltrs,
             isolation == Connection.TRANSACTION_SERIALIZABLE ?
@@ -7386,6 +7418,8 @@ public class UpdateLocksTest extends Bas
                     {_app, _ut, _r, "2", _X, _A, "(7,6)", _g, _a}}
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
@@ -7541,6 +7575,8 @@ public class UpdateLocksTest extends Bas
                     {_app, _ut, _r, "3", _X, _A, "(3,6)", _g, _a}}
             ));
         c.commit();
+        // wait for post-commit tasks before going on
+        s.execute("call wait_for_post_commit()");
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();



Mime
View raw message