Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

the bodyguard's story

 
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
 
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)
 
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
 
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic