• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFEJB page 354

 
Suman Sarker
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Page 354 of HFEJB it's shown that while in ejbActivate(), EntityContext can be used to
- get a reference to EJBObject
- get the primary key
We know that ejbActivate() is called to get a bean out of the pool. Now my question is if the bean is in the pool, how come we can get its EJBObject and the primary key.
Can anyone explain this?
Thanks
Suman
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EntityContext is always associated with the bean instance, so the instance can always get the PK. Note that information such as the PK, EJBObject and EJBLocalObject will change as the container assigns the instance to different EJB objects during the instance's life cycle.
 
Suman Sarker
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Roger for your reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic