Hi all,
at Syncope we have recently switched the application-managed db pool to HikariCP [1]; our (quite intensive, I'd say) tests with H2 and PostgresQL showed no issues at all.

Today I am testing MySQL and run unfortunately into a blocking issue: when running the OpenJPA SchemaTool as part of Syncope webapp initialization, an exception is reported by HikariCP:

MySQLNonTransientConnectionException: Can't call rollback when autocommit=true

No tables are created, and the OpenJPA initialization fails.

The reported stacktrace points to [2], from which I would say that the exception is quite right. The strange thing is that when using other connection pool libraries as Commons DBCP2, everything works fine.

Can someone explain why rollback is explicitly invoked after setting autocommit to true? (same applies to the commit statement few lines below).

Shouldn't it be better to make such behavior optional, anyway?

FYI, I have temporarily solved my issue by adding

relaxAutoCommit=true

to the JDBC URL, and all the integration tests run fine.

Please let me have your feedback, thanks.
Regards.

[1] https://issues.apache.org/jira/browse/SYNCOPE-1084
[2] https://github.com/apache/openjpa/blob/2.4.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java#L1267

--
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/

Reply via email to