jaybird
jaybird copied to clipboard
Change handling of TYPE_FORWARD_ONLY with HOLD_CURSORS_OVER_COMMIT
Currently, when a TYPE_FORWARD_ONLY is requested with HOLD_CURSORS_OVER_COMMIT, the result set is "upgraded" to TYPE_SCROLL_INSENSITIVE and a warning is registered. This upgrade is done because when using TYPE_SCROLL_INSENSITIVE, the entire result set is cached, so the result set is materialized immediately.
There are basically two alternatives:
-
(complex) if one or more result sets are HOLD_CURSORS_OVER_COMMIT, use commit/rollback retain and only really commit or rollback after all holdable result sets are closed.
-
(simple, quick&dirty) keep the current inner-workings that materialize the result set immediately, but wrap it so that it still behaves as a TYPE_FORWARD_ONLY (or use the existing
forwardOnly
parameter, which is used for "cached" result sets), removing the need for registering the upgrade warning.
Alternative option: add a connection property and/or system property to suppress/ignore JDBC warnings