db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r1330066 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/UpdateLocksTest.java
Date Tue, 24 Apr 2012 23:46:17 GMT
Author: myrnavl
Date: Tue Apr 24 23:46:16 2012
New Revision: 1330066

URL: http://svn.apache.org/viewvc?rev=1330066&view=rev
Log:
DERBY-5667; testReadCommitted(org.apache.derbyTesting.functionTests.tests.store.UpdateLocksTest)junit.framework.AssertionFailedError:
Missing rows in ResultSet
  adding call to wait for post-commit work after deletes.

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=1330066&r1=1330065&r2=1330066&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
Tue Apr 24 23:46:16 2012
@@ -117,6 +117,16 @@ public class UpdateLocksTest extends Bas
                     "on l.xid = t.xid " +
                     "where l.tableType <> 'S' and " +
                     "      t.type='UserTransaction'");
+                
+                // Create a procedure to be called before checking on contents
+                // to ensure that the background worker thread has completed 
+                // all the post-commit work.
+                s.execute(
+                    "CREATE PROCEDURE WAIT_FOR_POST_COMMIT() " +
+                    "LANGUAGE JAVA EXTERNAL NAME " +
+                    "'org.apache.derbyTesting.functionTests.util." +
+                    "T_Access.waitForPostCommitToFinish' " +
+                    "PARAMETER STYLE JAVA");
             }
         };
     }
@@ -6761,6 +6771,7 @@ 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 ?
@@ -6864,6 +6875,7 @@ public class UpdateLocksTest extends Bas
         ltrs = getLocks();
         JDBC.assertEmpty(ltrs);
         c.commit();
+        s.execute("call wait_for_post_commit()");
         JDBC.assertUnorderedResultSet(
             s.executeQuery("select * from a"),
             unPadded ?
@@ -7125,6 +7137,7 @@ 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 ?
@@ -7324,6 +7337,7 @@ 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 ?



Mime
View raw message