Issue Details (XML | Word | Printable)

Key: DERBY-3496
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Dyre Tjeldvoll
Reporter: Knut Anders Hatlen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

CallableStatement with output parameter leaves cursor open after execution

Created: 05/Mar/08 12:17 PM   Updated: 27/May/08 04:17 PM
Return to search
Component/s: JDBC
Affects Version/s: 10.4.1.3
Fix Version/s: 10.3.3.0, 10.4.1.3

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-3496.diff 2008-03-20 02:36 PM Dyre Tjeldvoll 1 kB
Text File Licensed for inclusion in ASF works junit-repro.diff 2008-03-05 12:21 PM Knut Anders Hatlen 1.0 kB
Issue Links:
Reference
 

Resolution Date: 25/Mar/08 01:38 PM


 Description  « Hide
When executing a CallableStatement which has an output parameter, the language result set is left open and makes subsequent calls to Connection.setTransactionIsolation() fail with "ERROR X0X03: Invalid transaction state - held cursor requires same isolation level".

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Knut Anders Hatlen added a comment - 05/Mar/08 12:21 PM
The attached patch (junit-repro.diff) adds a test case to jdbcapi/CallableTest which fails in both embedded and client/server mode.

$ java junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.jdbcapi.CallableTest
....E.............E.........
Time: 6.071
There were 2 errors:
1) testIsolationLevelChangeAfterFunctionCall(org.apache.derbyTesting.functionTests.tests.jdbcapi.CallableTest)java.sql.SQLException: Invalid transaction state - held cursor requires same isolation level
....
2) testIsolationLevelChangeAfterFunctionCall(org.apache.derbyTesting.functionTests.tests.jdbcapi.CallableTest)java.sql.SQLException: Invalid transaction state - held cursor requires same isolation level
....

Knut Anders Hatlen made changes - 05/Mar/08 12:21 PM
Field Original Value New Value
Attachment junit-repro.diff [ 12377162 ]
Knut Anders Hatlen added a comment - 05/Mar/08 12:25 PM
If the CallableStatement is closed before the isolation level is changed, it works in embedded mode, but it still fails the same way in client/server mode.

Knut Anders Hatlen made changes - 05/Mar/08 12:27 PM
Link This issue is related to DERBY-3427 [ DERBY-3427 ]
Dyre Tjeldvoll added a comment - 07/Mar/08 11:00 AM
Adding 10.3.2.2 and 10.4.0.0 as fix versions as it looks like a candidate for merging to 10.3

Dyre Tjeldvoll made changes - 07/Mar/08 11:00 AM
Fix Version/s 10.3.2.2 [ 12312885 ]
Fix Version/s 10.4.0.0 [ 12312540 ]
Dyre Tjeldvoll made changes - 19/Mar/08 03:48 PM
Assignee Dyre Tjeldvoll [ dyret ]
Dyre Tjeldvoll added a comment - 20/Mar/08 02:36 PM
Attaching derby-3496.diff which incorporates the new test case attached earlier.

Dyre Tjeldvoll made changes - 20/Mar/08 02:36 PM
Attachment derby-3496.diff [ 12378316 ]
Dyre Tjeldvoll made changes - 20/Mar/08 02:37 PM
Derby Info [Patch Available]
Knut Anders Hatlen added a comment - 21/Mar/08 07:53 AM
The fix looks correct to me, but the new line in EmbedCallableStatement is not indented correctly (probably due to incorrect tab size setting in your IDE).

Repository Revision Date User Message
ASF #640787 Tue Mar 25 12:34:18 UTC 2008 dyre DERBY-3496: CallableStatement with output parameter leaves cursor open after execution
Patch file: DERBY-3496.diff (fixed the indentation problem)
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CallableTest.java

Dyre Tjeldvoll added a comment - 25/Mar/08 12:40 PM
Committed revision 640787.

I did fix the indentation problem before committing. The "IDE" in question is 'vi'. :set hardtabs=4 (perhaps followed by :set autoindent) appears to be the magic words.

Dyre Tjeldvoll made changes - 25/Mar/08 12:40 PM
Derby Info [Patch Available]
Dyre Tjeldvoll made changes - 25/Mar/08 12:40 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Dyre Tjeldvoll added a comment - 25/Mar/08 12:42 PM
Need to merge it to release branch

Dyre Tjeldvoll made changes - 25/Mar/08 12:42 PM
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Dyre Tjeldvoll added a comment - 25/Mar/08 01:28 PM
Merged to 10.4 in revision 640801.

Repository Revision Date User Message
ASF #640801 Tue Mar 25 13:28:52 UTC 2008 dyre 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.4 with svn merge -r 640786:640787 ../derby-scratch
No conflicts
Files Changed
MODIFY /db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
MODIFY /db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CallableTest.java

Dyre Tjeldvoll added a comment - 25/Mar/08 01:38 PM
Merged to 10.3 with revision 640808.

Dyre Tjeldvoll made changes - 25/Mar/08 01:38 PM
Status Reopened [ 4 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Repository Revision Date User Message
ASF #640808 Tue Mar 25 13:39:16 UTC 2008 dyre 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
Files Changed
MODIFY /db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
MODIFY /db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/CallableTest.java

Knut Anders Hatlen made changes - 27/May/08 04:17 PM
Status Resolved [ 5 ] Closed [ 6 ]