-
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
Allow configuring the prepared statement cache #227
Comments
Sounds like a good enhancement. Do you want to submit a pull request? |
Yep. Can do. |
- Make PreparedStatementCache (and implementations) public - Expose preparedStatementCache discovery option. Similar to what r2dbc-postgresql exposes: -1 = indefinite cache, 0 = no cache, n = lru cache with max size n. - Add LRUPreparedStatementCache and NoPreparedStatementCache implementations. [r2dbc#227] Signed-off-by: Suraj Vijayakumar <[email protected]>
- Make PreparedStatementCache (and implementations) public - Expose preparedStatementCache discovery option. Similar to what r2dbc-postgresql exposes: -1 = indefinite cache, 0 = no cache, n = lru cache with max size n. - Add LRUPreparedStatementCache and NoPreparedStatementCache implementations. [r2dbc#227] Signed-off-by: Suraj Vijayakumar <[email protected]>
- Make PreparedStatementCache public - Expose preparedStatementCache discovery option. Similar to what r2dbc-postgresql exposes: -1 = indefinite cache, 0 = no cache, n = lru cache with max size n. - Add LRUPreparedStatementCache and NoPreparedStatementCache implementations. [r2dbc#227] Signed-off-by: Suraj Vijayakumar <[email protected]>
I see errors Actually not really fast, I do it by clicking a button repeatingly. If I click once per second, everything is fine. If I click faster I get the error sometimes. Sometimes it also seems to stuck and I get the error for every attempt. In one of my applications I enabled the R2DBC pool configuration what solved the problems. In another of my application the enabling the pool didn't change the behavior at all. What do you think. Can this PR solve this problem? |
Running into an error where the first time a query executes (using the cursored execution mode) it works, but running it again fails because my SQL Server didn't recognize the cached prepared statement handle.
In my use-case, disabling the statement cache would be sufficient - my queries don't run very often. But in general, perhaps having discovery options that can control this cache, or exposing
PreparedStatementCache
as a type that applications can provide their own implementation of, would be suitable?As a workaround I am reflectively updating the
ConnectionOptions.preparedStatementCache
field with my own "NoCache" implementation. But this is obviously not ideal.I'm using 0.8.5.RELEASE, and running on Java 11. SQL Server version is 2012.
The text was updated successfully, but these errors were encountered: