-->
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: Passing persistent objects between EJBs
PostPosted: Thu Jun 23, 2005 6:36 am 
Newbie

Joined: Tue May 17, 2005 10:55 am
Posts: 7
Hibernate version: 2.1

Scenario: Two stateless session beans (EJBs) in an application server:

EJB1 gets a new session
EJB1 creates an object 'A' and calls session.save();
EJB1 then calls EJB2, passing the ID of Object 'A'

EJB2 gets a new session
EJB2 loads object 'A' from with session.load(ID);
EJB2 changes a value in object 'A'
EJB2 returns

EJB1 does nothing, but can see the changed value in object 'A'

My questions:
1) How does EJB2 manage to see Object 'A' if it has not been flushed/commited to the database?
- Is the updated session passed to EJB2???

2) Are EJB1 and EJB2 actually using the same session as this is only one transaction?

3) If my application servers were clustered, would this fail if EJB1 was on a different node to EJB2?

Thank you for any help, I'm quite confused as to the caching by Hibernate, even after reading the HIA book, and running the scenario above!


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.