db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r382588 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ConnectionHandling.java
Date Fri, 03 Mar 2006 00:26:50 GMT
Author: djd
Date: Thu Mar  2 16:26:49 2006
New Revision: 382588

URL: http://svn.apache.org/viewcvs?rev=382588&view=rev
Log:
DERBY-444 add count to ConnectionHandling test output of how many
of the successfully opened Connections were closed due to
database shutdown.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ConnectionHandling.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ConnectionHandling.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ConnectionHandling.java?rev=382588&r1=382587&r2=382588&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ConnectionHandling.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ConnectionHandling.java
Thu Mar  2 16:26:49 2006
@@ -40,6 +40,8 @@
         new org.apache.derby.jdbc.EmbeddedDriver();
         
         Connection conn = DriverManager.getConnection("jdbc:derby:wombat;create=true");
+        conn.close();
+        conn = null;
         
         ArrayList list = new ArrayList();
         
@@ -107,11 +109,16 @@
         System.out.println("Failed Throwable    : " + fail_bad);
         
         System.out.println("closing connections : " + list.size());
+        int alreadyClosed = 0;
         for (int i = 0; i < list.size(); i++)
         {
-            ((Connection) list.get(i)).close();
+            Connection c = (Connection) list.get(i);
+            list.set(i, null);
+            if (c.isClosed())
+                alreadyClosed++;
+            
+            c.close();
         }
-        
-        conn.close();
- }
+        System.out.println("already closed      : " + alreadyClosed);        
+  }
 }



Mime
View raw message