-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: MySQL, Resin, JTA autocommit problems
PostPosted: Fri Aug 12, 2005 6:00 pm 
Newbie

Joined: Wed Sep 17, 2003 8:26 am
Posts: 16
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.