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 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.

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 added a comment - 20/Mar/08 02:36 PM
Attaching derby-3496.diff which incorporates the new test case attached earlier.

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).

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 added a comment - 25/Mar/08 12:42 PM
Need to merge it to release branch

Dyre Tjeldvoll added a comment - 25/Mar/08 01:28 PM
Merged to 10.4 in revision 640801.

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