db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1066911 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java
Date Thu, 03 Feb 2011 19:11:29 GMT
Author: dag
Date: Thu Feb  3 19:11:29 2011
New Revision: 1066911

URL: http://svn.apache.org/viewvc?rev=1066911&view=rev
Log:
DERBY-5001 Intermittent bug in InterruptResilienceTest

Fix to allow for lock interrupts during writing in the MT RAF test fixture.


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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java?rev=1066911&r1=1066910&r2=1066911&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/InterruptResilienceTest.java
Thu Feb  3 19:11:29 2011
@@ -419,7 +419,24 @@ public class InterruptResilienceTest ext
                     } else {
                         s.setLong(1, ops);
                         s.setString(2, getName());
-                        s.executeUpdate();
+
+                        try {
+                            s.executeUpdate();
+                        } catch (SQLException e) {
+                            // Occasionally we could see a lock wait being
+                            // interrupted: reconnect and continue. DERBY-5001.
+                            // See also LockInterruptTest.
+                            if ("08000".equals(e.getSQLState())) {
+                                c = thisConf.openDefaultConnection();
+                                s = c.prepareStatement(pStmtText);
+                                assertTrue(interrupted());
+                                interruptsSeen++;
+                                continue;
+                            } else {
+                                throw new Exception("expected 08000, saw" + e);
+                            }
+                        }
+
 
                         if (Thread.interrupted()) {
                             interruptsSeen++;



Mime
View raw message