Issue Details (XML | Word | Printable)

Key: JDBC-571
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Mark Rotteveel
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Jaybird JDBC Driver

Error "Current statement state (CURSOR_OPEN) does not allow call to prepare" when creating result set fails

Created: 28/Dec/18 07:55 PM   Updated: 25/May/19 10:03 AM
Component/s: JDBC driver
Affects Version/s: Jaybird 3.0.5, Jaybird 4
Fix Version/s: Jaybird 3.0.6, Jaybird 4

Issue Links:

 Description  « Hide
Running TestScalarTimeDateFunctions against Firebird 4 results in a reproducible case of "Current statement state (CURSOR_OPEN) does not allow call to prepare". The cause is similar to JDBC-531, except in this case initialization of the fields in the result set constructor fails due to an unsupported datatype (eg TIMESTAMP WITH TIME ZONE). The failure to create the result set causes the result set to never be closed, and therefor the cursor state is never reset (and the serverside cursor never closed).

We need to carefully check if other types of exception can also lead to not properly closing result sets / cursors. We may also want to consider implementing a stopgap measure that prevents this problem from causing problems outside the driver (eg by forcibly resetting the statement if the state is CURSOR_OPEN). Maybe FBStatement.notifyStatementStarted should call something on FbStatement that forces a close if necessary.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 28/Dec/18 07:56 PM
NOTE: Jaybird 2.2 is probably also affected, but we're not going to fix it there.

Mark Rotteveel added a comment - 29/Dec/18 01:36 PM - edited
Committed fix for 3.0.6 and 4