-->
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.  [ 2 posts ] 
Author Message
 Post subject: Question about re-enabling autocommit
PostPosted: Tue Dec 29, 2015 5:47 am 
Newbie

Joined: Tue Dec 29, 2015 5:33 am
Posts: 1
Hi. I am using hibernate 4.3.5.Final, DB Derby 10.
In my hibernate.cfg.xml i use property <property name="hibernate.connection.autocommit">false</property> for disabling autocommit,
but in DEBUG mode i see this:

12:36:32,208 DEBUG http-bio-8080-exec-4 JdbcTransaction:doCommit:113 - committed JDBC Connection
12:36:32,208 DEBUG http-bio-8080-exec-4 JdbcTransaction:releaseManagedConnection:126 - re-enabling autocommit
12:36:32,208 DEBUG http-bio-8080-exec-4 LogicalConnectionImpl:releaseConnection:246 - Releasing JDBC connection
12:36:32,208 DEBUG http-bio-8080-exec-4 LogicalConnectionImpl:releaseConnection:264 - Released JDBC connection

re-enabling autocommit, what i am doing wrong?


Top
 Profile  
 
 Post subject: Re: Question about re-enabling autocommit
PostPosted: Tue Dec 29, 2015 6:44 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
In Hibernate, when opening a JDBC connection, the JDBC Transaction verifies the auto-commit status of the underlying connection and disables this feature upon fetching the connection and resets it back when releasing it.

If you don't want this behavior and you're using an external connection pool, you can turn of autocommit at the DataSource level.
For example, when using DBCP2 ( https://commons.apache.org/proper/commons-dbcp/configuration.html ), you can set the defaultAutoCommit property to false, and then Hibernate will not toggle the autocommit status on the underlying physical connection.


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

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.