JDBC commit failed, calling commit when autocommit=true. Multithreaded hibernate session somehow changing autocommit?
Even though I think you should seriously reconsider the way you are using Hibernate, you can bypass this issue by adding a relaxAutoCommit
parameter to the JDBC driver in its URL.
Details from MySQL documentation:
relaxAutoCommit
If the version of MySQL the driver connects to does not support transactions, still allow calls to commit(), rollback() and setAutoCommit() (true/false, defaults to 'false')?
Default: false
Since version: 2.0.13
Source: https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html
found the answer in a blog, the solution quotes:
Setting the attribute relaxAutoCommit=true in the jdbc url we solved our problem.
jdbc:mysql://dbserver/database?rewriteBatchedStatements=true&relaxAutoCommit=true
Of course the blog is in another scenario, just skip the "rewriteBatchedStatements=true" part