• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

the bodyguard's story

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic