Issue Details (XML | Word | Printable)

Key: JDBC-307
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 JCA/JDBC Driver

ResultSet of type CLOSE_CURSORS_AT_COMMIT isn't closed on commit

Created: 30/Mar/13 01:27 PM   Updated: 19/Oct/15 03:40 PM
Component/s: JDBC driver
Affects Version/s: Jaybird 2.1.6, Jaybird 2.2, Jaybird 2.2.1, Jaybird 2.2.2
Fix Version/s: Jaybird 2.2.9, Jaybird 3.0.0

Issue Links:

 Description  « Hide
ResultSet of type CLOSE_CURSORS_AT_COMMIT isn't closed on commit when autocommit is disabled.

Subsequent execution of for example will result in an exception from the server:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -504
Invalid cursor reference
Cursor is not open

Instead of the expected message "The result set is closed" from method checkCursorMove(). For a scrollable (== cached) resultset, the user can continue scrolling after commit when the resultset should report "The result set is closed" as well.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 30/Mar/13 01:47 PM
Deferring to Jaybird 2.3. Fixing this requires a big overhaul of how commit is signaled to the various parts of Jaybird (without resorting to a big kludge) and this essentially has been broken at least since Jaybird 2.1.x.

Mark Rotteveel added a comment - 05/Jun/15 02:44 PM
Given JDBC-400, the implications of this bug seem to be bigger. Tentatively scheduling for version 2.2.9.

Mark Rotteveel added a comment - 25/Jun/15 07:30 PM
While working on JDBC-399 I found a fix for this.

Mark Rotteveel added a comment - 25/Jun/15 08:16 PM
It looks like the bug was somewhat intentional: not closing the result set has a performance benefit: the server side cursor is closed by the commit, completing the statement before the commit will do a network roundtrip to explicitly close the cursor. I will need to keep the performance benefit of the bug without the incorrect result set behavior.

Mark Rotteveel added a comment - 02/Jul/15 07:01 PM - edited
Made some changes to not free the serverside cursor before commit. This works, but it is a bit of a tangle. I will need to see if I can change this to be a more localized solution in Jaybird 3 (or 3.1) without having to go through several layers of indirection.