-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Transaction isolation applied to running transaction in HikariPool #24
Comments
I am committing a fix for the former. The trouble with the later is that the user can alter the isolation level of the connection, just like auto-commit, and therefore it needs to be reset. |
Fix committed to |
Thanks. Regarding the caching thing, I thought of this: Make getTransactionIsolation really cheap by caching the isolation level in a field in the wrapping Connection. getConnection on the pool then can call the now cheap getTransactionIsolation and only call setTransactionIsolation if the default pool level is different, thus saving the roundtrip to the database. But if that really is worth the added complexity is up to you. |
It's not necessarily the complexity I worry about, I'm more concerned that there is a reason that PostgreSQL is required to make the roundtrip. Otherwise, why would they have implemented the driver that way? |
That's a good point. Seems more like an optimization the driver should do if possible. I will check with the pgjdbc team. |
You may be interested in this thread: https://groups.google.com/forum/#!topic/hikari-cp/7hgIWvE7DiY Basically, like PostgreSQL, this user found that SQL Server performs a roundtrip on |
Thanks for the info. Just as a follow up: |
I am running HikariCP 1.2.4 with
Because HikariPool does not reset the autocommit flag (to its default of true) when the connection is returned to the pool, this leads to (comments inline, code from HikariPool, line 152):
I also noticed while debugging that postgres (in my case) will perform a roundtrip to the database on
Maybe the transaction isloation could be cached by HikariCP and only set once on creation of the actual connection?
The text was updated successfully, but these errors were encountered: