-->
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: JTA and after_statement
PostPosted: Wed Jun 09, 2010 10:57 am 
Newbie

Joined: Wed Jun 09, 2010 10:37 am
Posts: 1
Hi,

I'm successfully using JTA with Hibernate to synchronise concurrent writes to multiple sessions in multiple databases. Things are working fine, but I have a question regarding the Connection Release Mode.

I've read in several distinct places that when using JTA and XADatasources, one should the "after_statement" connection release mode. This is also enforced by the JTASessionContext. Everywhere I read that one should use this aggressive release mode, but nowhere I find the rationale. Why do we need to use this? There's an impact on performance when making lots of requests (bulk inserts for example).

A few quotes from the Hibernate documentation:
Quote:
after_transaction: uses ConnectionReleaseMode.AFTER_TRANSACTION. This setting should not be used in JTA environments.

Quote:
For an application server JTA datasource, use after_statement to aggressively release connections after every JDBC call.


I tried both after_transaction and after_statement and both work well under my test case, although after_transaction if faster. Obviously, I don't want to use after_transaction if it can have serious side-effects. Can someone point me to a detailed explanation of why we must use after_statement? Please don't spare any technical details, I'd really like to fully understand this.

Cheers,
Philippe


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.