-->
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.  [ 3 posts ] 
Author Message
 Post subject: Transaction settings related question
PostPosted: Tue Mar 09, 2010 12:36 pm 
Beginner
Beginner

Joined: Wed Mar 03, 2010 3:35 pm
Posts: 37
when one service method which has tx setting as propagation="REQUIRES_NEW" invokes another service method with the same settings, does the second method use the same session or does it create a new one(assuming the default contextual settings are used)? If not what decides whether a new session is opened or the existing one is used in the invoked method, it would be great if someone can make this clear. thanks,


regards
Aravias


Top
 Profile  
 
 Post subject: Re: Transaction settings related question
PostPosted: Tue Mar 09, 2010 8:10 pm 
Senior
Senior

Joined: Wed Sep 19, 2007 9:31 pm
Posts: 191
Location: Khuntien (Indonesia)
if you use REQUIRES_NEW, the container always create a new transaction. If the client already has a transaction, it's temporarily suspended until the method returns.
It means that the success of failure of the new transaction has no effect on the existing transaction.


Top
 Profile  
 
 Post subject: Re: Transaction settings related question
PostPosted: Tue Mar 09, 2010 8:50 pm 
Beginner
Beginner

Joined: Wed Mar 03, 2010 3:35 pm
Posts: 37
Thanks for the reply.I understand that part but what I am not able to figure out is whether the same session is used or does it create a new one when u say requires_new, I guess if its the same thread then its uses the suspended transactions session otherwise it creates its own session.What is the default settings for Contextual sessions in hibernate, does each thread which creates a session make it available for other transactions spawned from that same thread or does it have to be set explicitly to do that?


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