You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2008/01/22 19:13:21 UTC

svn commit: r614277 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java

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();
        }
       
 }