-->
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: Behavior of connection release does not conform to manual
PostPosted: Thu Feb 12, 2015 1:40 am 
Newbie

Joined: Thu Feb 12, 2015 1:09 am
Posts: 1
Hi all,

The manual says:
auto (the default): this choice delegates to the release mode returned by the org.hibernate.transaction.TransactionFactory.getDefaultReleaseMode() method. For JTATransactionFactory, this returns ConnectionReleaseMode.AFTER_STATEMENT; for JDBCTransactionFactory, this returns ConnectionReleaseMode.AFTER_TRANSACTION.

http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html_single/#transactions-connection-release

According to manual, when I set
Code:
hibernate.connection.release_mode=auto
hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory

The actually release mode should be AFTER_TRANSACTION.


But in fact, when I run the application with above configuration, it's behavior does not equal to the same application with following setting
Code:
hibernate.connection.release_mode=AFTER_TRANSACTION


Anything I missed?



My setup information:
hibernate 4.3.8 +
java 8/spring 4.1.4/hikariCP 2.3.2


Top
 Profile  
 
 Post subject: Re: Behavior of connection release does not conform to manual
PostPosted: Tue Sep 15, 2015 10:47 am 
Newbie

Joined: Tue Sep 15, 2015 10:12 am
Posts: 1
We are currently upgrading from Hibernate 3 to 5 and noticed the same behavior: Hibernate defaults the connection release mode to "on_close" when the factory class is JDBCTransactionFactory:

https://github.com/hibernate/hibernate-orm/blob/5.0/hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jdbc/internal/JdbcResourceLocalTransactionCoordinatorBuilderImpl.java

Setting AFTER_TRANSACTION solved the issue for us but we're still testing:

Code:
hibernate.connection.release_mode=after_transaction

I couldn't find a section on Connection Release Modes in the Hibernate 5 ORM User Guide so I'm not sure if this is a bug or if we're doing something wrong. The JavaDoc for ConnectionReleaseMode says "on_close" is legacy (Hibernate2 and pre-3.1) behavior.

We are using Hibernate 5.0.1.FINAL.


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.