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 dy...@apache.org on 2008/03/25 14:39:28 UTC

svn commit: r640808 - in /db/derby/code/branches/10.3/java: engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CallableTest.java

Author: dyre
Date: Tue Mar 25 06:39:16 2008
New Revision: 640808

URL: http://svn.apache.org/viewvc?rev=640808&view=rev
Log:
DERBY-3496: CallableStatement with output parameter leaves cursor open after exe
cution

Close the result set used to get the output parameter of
an EmbedCallableStatement

Merged to 10.3 with svn merge -r 640786:640787 ../derby-scratch
No conflicts

Modified:
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CallableTest.java

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java?rev=640808&r1=640807&r2=640808&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java (original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java Tue Mar 25 06:39:16 2008
@@ -149,6 +149,7 @@
 					throw EmbedResultSet.noStateChangeException(e);
 				}
 				finally {
+					results.close();
 					results = null;
 				}
 

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CallableTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CallableTest.java?rev=640808&r1=640807&r2=640808&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CallableTest.java (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CallableTest.java Tue Mar 25 06:39:16 2008
@@ -295,6 +295,16 @@
         cs.close();
     }
 
+    public void testIsolationLevelChangeAfterFunctionCall()
+            throws SQLException {
+        CallableStatement cs = prepareCall("? = CALL NO_IN_ONE_OUT_FUNC()");
+        cs.registerOutParameter(1, java.sql.Types.INTEGER);
+        cs.execute();
+        assertEquals(55, cs.getInt(1));
+        getConnection().setTransactionIsolation(
+            Connection.TRANSACTION_SERIALIZABLE);
+    }
+
     /**
      * Calls a SQL procedure that outputs a message with System.out.println.
      * Converted from the original test, but initially disabled because of the