-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure thatPreferredCursorExecution
is the only configuration flag to control cursor preference
#267
Comments
Currently, you can force direct execution by specifying the fetch size to zero. |
Unfortunately the fetchSize is not applied in all situations. @OverRide
MssqlStatementSupport:
|
Not quite sure we're on the same page. You can set the fetch size yourself via |
Unfortunately I am running a Spring Boot JPA application with a connection pool. From the call stack of the creation of SimpleMssqlStatement I see: In short, execute is called directly after creation of the statement. Probably the options should include the fetchSize so that it can be applied during the constructor of SimpleMssqlStatement. The fetchSize optimally would be set using @QueryHint in JPA. |
PreferredCursorExecution
is the only configuration flag to control cursor preference
We will move the predicate evaluating |
… control cursor preference. [resolves #267] Signed-off-by: Mark Paluch <[email protected]>
It should be possible to specify that cursors not be used.
I receive the message "Could not complete cursor operation because the table schema changed after the cursor was declared.". The query completes successfully when run without using cursors. The schema on the database did in fact change.
Whether cursors are used or not is determined by the following code in SimpleMssqlStatement.java
It is not clear whether the author deliberately checks the sql string starting with 's' or 'S' rather than the trimmed string. Anyway both checks do not take into account that the SQL may start with a comment.
As a consequence, it is possible to force cursors to not be used by starting the statement with a space. This feels like exploiting another bug so if this is fixed this workaround will no longer work,
It also means that you cannot use automatically generated statements such as those produced by JPA.
The text was updated successfully, but these errors were encountered: