-->
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: Nested transaction and Session
PostPosted: Wed Nov 05, 2003 5:28 am 
Beginner
Beginner

Joined: Wed Aug 27, 2003 6:15 am
Posts: 22
Hi all

Supposed I have 2 EJB, A and B. Each starts its own transaction by declaring "RequiresNew".

Then, in EJBA, we retreive an object and examine its value. Afterwards we make a call to EJBB, which retrieves the same object and alter its value. When EJBB returns, the new value will be committed to the DB. What happens to the object back in the first transaction?

Will the Session object be smart enough to know this? How can I make sure EJBA does not get stale data?

Thanks a lot.

Regards
Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 05, 2003 9:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Depends if both of the ejbs are using the same session or not.

If it's the same session, then the initial ejb would see the changes made by the subsequent ejb.

If they use different sessions, then the opposite would be true. You would need to reload or refresh the entity back in the initial ejb.


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.