Hi,
I have the feeling, this has been asked before, but I did not find a solution in the docs: I have a problem with Hibernate 2.1 & Resin 3 and MySQL Connector 3.1. I get the following Exception:
2005-08-12 23:53:26,534 [tcp-connection-0] WARN net.sf.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: null
2005-08-12 23:53:26,535 [tcp-connection-0] ERROR net.sf.hibernate.util.JDBCExceptionReporter - Can't call commit when autocommit=true
2005-08-12 23:53:26,536 [tcp-connection-0] ERROR net.sf.hibernate.util.JDBCExceptionReporter - Could not save object
java.sql.SQLException: Can't call commit when autocommit=true
at com.mysql.jdbc.Connection.commit(Connection.java:2145)
at com.mysql.jdbc.jdbc2.optional.ConnectionWrapper.commit(ConnectionWrapper.java:415)
at com.caucho.sql.UserConnection.commit(UserConnection.java:577)
at net.sf.hibernate.id.TableGenerator.generate(TableGenerator.java:126)
at net.sf.hibernate.id.TableHiLoGenerator.generate(TableHiLoGenerator.java:59)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:758)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:731)
I'm using the Resin's connection pool via JNDI. AFAIK, JDBC-Connections default to autocommit=true. How can I set them to false? I tried several things, but nothing did the trick.
I read somewhere that Hibernate changes the autocommit-setting for connections supplied by the internal pool immediately but not so with connections supplied by an external pool. How can I change that behaviour?
Jan
|