db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r508558 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java
Date Fri, 16 Feb 2007 20:20:01 GMT
Author: djd
Date: Fri Feb 16 12:20:00 2007
New Revision: 508558

URL: http://svn.apache.org/viewvc?view=rev&rev=508558
Log:
Close some JBDC objects left open in BlobClob4BLobTest.java

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java?view=diff&rev=508558&r1=508557&r2=508558
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java
Fri Feb 16 12:20:00 2007
@@ -74,6 +74,7 @@
         Statement stmt = createStatement();
         stmt.executeUpdate("DROP TABLE testClob");
         stmt.executeUpdate("DROP TABLE testBlob");
+        stmt.close();
         commit();
         super.tearDown();
     }
@@ -94,6 +95,7 @@
         ps.setCharacterStream(1, streamReader, clobLength);
         ps.executeUpdate();
         streamReader.close();
+        ps.close();
         commit();
 
         Statement stmt = createStatement();
@@ -367,6 +369,7 @@
             }
         }
         rs.close();
+        stmt.close();
     }
 
     /**
@@ -1169,6 +1172,7 @@
         ps.setInt(6, 1);
         ps.executeUpdate();
         streamIn.close();
+        ps.close();
         commit();
 
         stmt = createStatement();
@@ -1196,7 +1200,7 @@
         }
         stmt2.close();
         conn2.commit();
-        stmt.close();
+        conn2.close();
     }
 
     /**
@@ -1303,6 +1307,7 @@
                 shortClob = rs.getClob(1);
         }
         rs.close();
+        stmt.close();
         commit();
         getConnection().close();
 
@@ -1517,7 +1522,7 @@
         insertDefaultData();
         Statement stmt = createStatement();
         ResultSet rs = stmt.executeQuery("select a, b from testClob");
-        byte[] buff = new byte[128];
+
         Clob[] clobArray = new Clob[10];
         int[] clobLengthArray = new int[10];
         int j = 0;
@@ -2104,19 +2109,21 @@
         Statement stmt2 = conn2.createStatement();
         stmt2.executeUpdate("update testBlob set a = null where b = 26");
         assertEquals("FAIL - blob was updated", 26, shortBlob.length());
-        stmt2.close();
 
         // should timeout waiting for the lock to do this
         try {
-            stmt2 = conn2.createStatement();
+            
             stmt2.executeUpdate(
                     "update testBlob set b = b + 1 where b = 10000");
             fail("FAIL - should have gotten lock timeout");
         } catch (SQLException se) {
             checkException(LOCK_TIMEOUT, se);
         }
+        stmt.close();
+        stmt2.close();
         commit();
         conn2.commit();
+        conn2.close();
     }
 
     /**
@@ -2143,6 +2150,7 @@
         ps.setInt(6, 1);
         ps.executeUpdate();
         streamIn.close();
+        ps.close();
         commit();
 
         stmt = createStatement();
@@ -2170,6 +2178,7 @@
         stmt2.close();
         conn2.commit();
         stmt.close();
+        conn2.close();
     }
 
     /**
@@ -2191,6 +2200,7 @@
                 shortBlob = rs.getBlob(1);
         }
         rs.close();
+        stmt.close();
         commit();
 
 
@@ -2364,7 +2374,7 @@
         insertDefaultData();
         Statement stmt = createStatement();
         ResultSet rs = stmt.executeQuery("select a,b from testBlob");
-        byte[] buff = new byte[128];
+
         Blob[] blobArray = new Blob[10];
         int[] blobLengthArray = new int[10];
         int j = 0;



Mime
View raw message