• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbRemove() doesn't call ejbPassivate() ? - HFE p371 question #16

 
Van Nguyen
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
16. Which additional method(s) might the container call when invoking ejbRemove?
e. ejbPassivate() - is not one of the answers. Why not?
My understanding is that after the container calls ejbActivate() - loads the data into the bean -calls ejbLoad() to tell the bean that it's been loaded. The bean/container deletes the entity in the db.
After this, doesn't the bean still exist? doesn't it go back into the pool so that it can be activated and loaded with another entities data? much like a stateless session bean? Thus I think ejbPassivate() may be called by the container.
If not the pool would shrink everytime an ejbRemove() is called.
Any thoughts?
 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Van,
A bean doing an ejbRemove() method will NOT be passivated before going back to the pool!!
See HFE p.321.
Regards,
Cyril.
 
Van Nguyen
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi cyril,
thanks for the reply. I see the comment on p.321. I get it now. ejbRemove() brings it to pooled state. I was confused, I was assuming that ejbRemove() would bring it to "does not exist" state.
thanks very much for clearing that up for me.
-Van
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Van Nguyen:
thanks for the reply. I see the comment on p.321. I get it now. ejbRemove() brings it to pooled state. I was confused, I was assuming that ejbRemove() would bring it to "does not exist" state.
-Van

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic