Issue Details (XML | Word | Printable)

Key: JDBC-482
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Mark Rotteveel
Votes: 0
Watchers: 0
Operations

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

Remove retrieval of sql counts on execute in GDS layer

Created: 07/Mar/17 04:51 PM   Updated: 07/May/17 12:32 PM
Component/s: JDBC driver, JNI/JNA layer, Wire protocol
Affects Version/s: Jaybird 3.0.0-beta-3, Jaybird 3.0.0
Fix Version/s: Jaybird 3.0.0


 Description  « Hide
We currently always retrieve SQL counts on execute in the GDS layer, instead we should only retrieve it when JDBC requires it (ie: when using executeUpdate, or with an explicit call of getUpdateCounts).

In earlier versions this made sense because we pipelined the count request immediately after the execute, but since adding cancellation support we had to split that again into separate request/response pairs. Only explicitly requesting this when needed may have a small performance benefit.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 07/Mar/17 04:51 PM - edited
Consider including for 3.0, if it requires too much restructuring, then delay to 3.1.

Mark Rotteveel added a comment - 11/Mar/17 01:11 PM
Current code already obtains update count if it wasn't retrieved previously, so I deleted the low-level getSqlCounts immediately after execute and after fetching all rows.

This should restore the behavior as it was in Jaybird 2.2, and result in a minor performance improvement when processing result sets, but never obtaining update counts, or when using execute() instead of executeUpdate() (eg when not interested in update counts).

As part of this I also fixed in bug with `getMoreResults()` that did not correctly handle closing of a result set (or server side cursor) if the result set had never been obtained from the statement (eg when using execute, but not calling getResultSet).