• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in entitybean bean pool( EJB2.0 )

 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
when a entity bean is passivated the associated data is stripped off and i guess the same happens to its kin Entitycontext object.And some other data is loaded into that bean instance.
when the old client comes again and wants to continue from where it has left
we use the Entitycontexts getPrimaryKey() in ejbLoad() to load its data to some other available enity bean instance.where does this Entitycontext comes from.Howcome the context object maintaines the primary key when the actual bean itself gone.
please clarify me.

--------------------
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When ejbLoad() is invoked, you can assume that the data has already been loaded. The entity object identity is assigned to a given bean instance when ejbActivate() is called and is valid up until ejbPassivate() or ejbRemove() is invoked. (EJB 2.1 section 10.5.2)

So your question is how the container remembers that the entity context of a given bean instance keeps the identity of the underlying entity object even though the bean instance is not associated with the entity object ? Do I understand this right?
 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes you are right.i want to know what happens to the entity context obejct when the bean is passivated.will the container keeps it with him.when the very bean instance is used to represent another thing i guess the same entitycontext is used.Then how does it maintaines the ealier primary keys.
 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone clarify my doubt
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic