Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

the bodyguard's story

 
Swamy Nathan
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a stateful session bean is passivated what happens to the associated EJBObject implementation instance (the bodyguard) inside the container?

How long does the EJBObject implementation instance (the bodyguard) stay alive in the container for the following beans?
1 a stateless session,
2 a stateful session
3 a entity bean
 
Dan T
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bodyguard stays in the container (alive) when the bean is passivated. If the EJbObject (bodyguard) was passivated as well, how can the client make another business call? It would have no way to tell the container that he/she is ready to make another call.

Session:
Once the EJBObect (bodyguard) is created, it is NOT alive in the container if the container calls ejbRemove() (either client calls remove, or times out during active), when the container crashes, and times out during passivate (for statefull, gc is called).

Entity:
The EJBObject is alive once the client calls the create() on the home interface. The EJBObject might be on the container as long as the client does not remove the entity in the database, because the client is allowed to invoke the findByPrimaryKey(key), and states the Container can either make or find an EJBObject. (Not sure if guaranteed by container)
 
Joe Nguyen
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not scalable. The unused EJBObjects will stay and occupy space in the heap. Does the container implement LRU to remove these EJBObjects
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic