db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r788968 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi: ResultSetMiscTest.java SetTransactionIsolationTest.java
Date Sat, 27 Jun 2009 13:19:39 GMT
Author: kahatlen
Date: Sat Jun 27 13:19:39 2009
New Revision: 788968

URL: http://svn.apache.org/viewvc?rev=788968&view=rev
Log:
DERBY-4273: A lock could not be obtained within the time requested error in testBTreeForwardScan_fetchRows_resumeAfterWait_nonUnique_split

Use DatabasePropertyTestSetup to set timeout in ResultSetMiscTest and
SetTransactionIsolationTest, so that the values are reset before
IndexSplitDeadlockTest starts.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetMiscTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetTransactionIsolationTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetMiscTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetMiscTest.java?rev=788968&r1=788967&r2=788968&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetMiscTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetMiscTest.java
Sat Jun 27 13:19:39 2009
@@ -21,7 +21,6 @@
 
 package org.apache.derbyTesting.functionTests.tests.jdbcapi;
 
-import java.sql.CallableStatement;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
@@ -35,6 +34,7 @@
 import org.apache.derbyTesting.functionTests.util.SecurityCheck;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
+import org.apache.derbyTesting.junit.DatabasePropertyTestSetup;
 import org.apache.derbyTesting.junit.TestConfiguration;
 import org.apache.derbyTesting.junit.Utilities;
 
@@ -463,14 +463,6 @@
     public void testBug4810() throws SQLException {
         Connection con = getConnection();
 
-        CallableStatement cs = con
-                .prepareCall("CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?, ?)");
-        cs.setString(1, "derby.locks.deadlockTimeout");
-        cs.setString(2, "3");
-        cs.execute();
-        cs.setString(1, "derby.locks.waitTimeout");
-        cs.setString(2, "3");
-        cs.close();
         Statement stmt = con.createStatement();
         stmt.executeUpdate("create table bug4810(i int, b int)");
         stmt
@@ -768,7 +760,11 @@
         TestSuite suite = new TestSuite(name);
         suite.addTestSuite(ResultSetMiscTest.class);
 
-        return new CleanDatabaseTestSetup(suite) {
+        // Some test cases expect lock timeouts, so reduce the timeout to
+        // make the test go faster.
+        Test test = DatabasePropertyTestSetup.setLockTimeouts(suite, 1, 3);
+
+        return new CleanDatabaseTestSetup(test) {
             /**
              * Creates the table used in the test cases.
              * 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetTransactionIsolationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetTransactionIsolationTest.java?rev=788968&r1=788967&r2=788968&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetTransactionIsolationTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetTransactionIsolationTest.java
Sat Jun 27 13:19:39 2009
@@ -22,7 +22,6 @@
  */
 package org.apache.derbyTesting.functionTests.tests.jdbcapi;
 
-import java.sql.CallableStatement;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
@@ -34,6 +33,7 @@
 
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
+import org.apache.derbyTesting.junit.DatabasePropertyTestSetup;
 import org.apache.derbyTesting.junit.RuntimeStatisticsParser;
 import org.apache.derbyTesting.junit.SQLUtilities;
 import org.apache.derbyTesting.junit.TestConfiguration;
@@ -222,7 +222,11 @@
         TestSuite suite = new TestSuite(name);
         suite.addTestSuite(SetTransactionIsolationTest.class);
 
-        return new CleanDatabaseTestSetup(suite) {
+        // Some test cases expect lock timeouts, so reduce the timeout to
+        // make the test go faster.
+        Test test = DatabasePropertyTestSetup.setLockTimeouts(suite, 1, 3);
+
+        return new CleanDatabaseTestSetup(test) {
 
             /**
              * Create and populate table
@@ -268,15 +272,6 @@
                 s.executeUpdate("INSERT INTO T1 VALUES(3,'Third Hello')");
 
                 s.executeUpdate("create table t3 (i integer)");
-                
-
-                CallableStatement cs = conn
-                        .prepareCall("CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY (?, ?)");
-                cs.setString(1, "derby.locks.waitTimeout");
-                cs.setString(2, "3");
-                cs.execute();
-                cs.setString(1, "derby.locks.deadlockTimeout");
-                cs.setString(2, "3");
             }
 
         };



Mime
View raw message