-
Notifications
You must be signed in to change notification settings - Fork 231
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
Could not start the transaction - Cannot change transaction isolation level in the middle of a transaction #376
Comments
I comment this line code in Sql2o class |
Hi @pikantono, thanks for letting me know about this issue. I've investigated the problem, and as far as I understand, it is an issue with the connection pool when auto-commit is set to false. The line cannot be removed without removing some core functionality from Sql2o, but I think I've found a workaround. I'll build a new version shortly with a possible fix. Another fix is to remove |
Looking a little more into this, I suspect that setting |
…ommit is set to false on data source level
I've released version 1.9.0. Please confirm if this fixes your problem :) |
When we use connection pool like HickariCP , ... a DataSource will be passed as argument to "Sql2o( dataSource )" class.
So, we sets IsolationLevel in config of DataSource and at this line isolation level changed !
sql2o/core/src/main/java/org/sql2o/Sql2o.java
Line 300 in f9a9091
and always we got exception of :
when a external data source is used must be ignored to change isolation level again
new constructor needs I think !
The text was updated successfully, but these errors were encountered: