-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate, Weblogic and XA Transactions
PostPosted: Fri Aug 19, 2005 2:02 pm 
Newbie

Joined: Mon Jul 25, 2005 12:59 pm
Posts: 13
Hi,
regarding http://forum.hibernate.org/viewtopic.php?t=945497&highlight=
I would like to ask the forum again what is the sense of
Code:
hibernate.connection.release_mode=after_statement
configuration setting. The documentation says that Hibernate will release the JDBC connection after each statement execution and this is the suggested strategy to use in a JTA environment. Why? Why should the connection be released after statement execution and not at the end of a transaction? And what happens with the connection obtained via session.connection() call when this setting is used? Is the app code responsible for the connection close?
It would be really helpful to us to know your opinion. We have to find out whether it's a WebLogic problem or not (see http://forum.hibernate.org/viewtopic.php?t=945497&highlight=).

Best regards,
Sergiy


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 19, 2005 2:13 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
Why? Why should the connection be released after statement execution and not at the end of a transaction?


Because JTA does not call beforeTransactionCompletion() if the transaction is being rolled back, and so there would be no chance to close the connection.

Quote:
And what happens with the connection obtained via session.connection() call when this setting is used?


I must admit I never really thought about it. I assumed that in a CMT/JCA environment, you just obtain the connection the normal way via the Datasource. JCA guarantees it is the same underlying connection Hibernate is using.

However, I can see in your other post that if you do get the Connection via Session.connection(), you have a problem releasing it. We'll have to change the impl of Session.connection() when release_mode=after_statement.

The workaround, of course, is to get the connection in the standard J2EE way....


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 19, 2005 2:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Fixed in CVS. Note that it is the application's responsibility to call connection.close().


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 19, 2005 4:15 pm 
Newbie

Joined: Mon Jul 25, 2005 12:59 pm
Posts: 13
Thanks a lot Gavin! I thank you really very much.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 19, 2005 5:04 pm 
Newbie

Joined: Mon Jul 25, 2005 12:59 pm
Posts: 13
...just one remark: it would make sense to put the comment about the app responsibility to close the connection into the API documentation for Session.connection() method.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.