db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r614277 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
Date Tue, 22 Jan 2008 18:13:21 GMT
Author: kmarsden
Date: Tue Jan 22 10:13:17 2008
New Revision: 614277

URL: http://svn.apache.org/viewvc?rev=614277&view=rev
Log:
DERBY-3233 ComparisonFailure in derbyStress

Change test to close connection to ensure all result sets are closed before dropping the table.


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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java?rev=614277&r1=614276&r2=614277&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
Tue Jan 22 10:13:17 2008
@@ -150,11 +150,10 @@
           ps.setString(1,"hello");
           ps.executeUpdate();
           ps.close();
-          ResultSet rs = null;
           for (int i = 0; i < 2000; i++)
           {
                   s = conn.createStatement();
-                  rs = s.executeQuery("SELECT * from tab");
+                  ResultSet rs = s.executeQuery("SELECT * from tab");
                   // drain the resultset
                   while (rs.next());
                   // With DERBY-3316, If I don't explicitly close the resultset or 
@@ -162,14 +161,14 @@
                   //rs.close();
                   //s.close();
           }    
-          // close the final ResultSet and gc() so we won't have a 
-          // ResultSet reference when we try to drop the table.
-          rs.close();
-          rs = null;
-          System.gc();
+          // close the connection to free up all the result sets that our sloppy 
+          // user didn't close.
+          conn.close();
+          conn = ij.startJBMS();
           s = conn.createStatement();
           s.executeUpdate("DROP TABLE TAB");
           s.close();
+          conn.close();
        }
       
 }



Mime
View raw message