• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB Question?

 
Raja Mani
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is ejbPassivate() invoked by the container when ejbRemove() is invoked?
� a. true
� b. false

Any of you please get me the right answer?
 
Mat Williams
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I do not believe that ejbPassivate is called prior to ejbRemove, or after it is called. I have not found anything in the spec that says ejbPassivate is called either, for any type of bean (Stateful, Statless, Entity, CMT, BMT, BMP, or CMP). I dont think it would make sense for the container to invoke ejbPassivate before or after ejbRemove either - certainly not after!! So I think the answer should be False (B).

Please feel free to correct me if I am wrong, as I am not an expert on EJB.

Mat
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a BMP, like the following one, and test the remove method.

I actualy use this BMP in a BMP Tutorial to demonstrate how the various lifecylce methods work, but I don't think I called the ejbRemove method in the demo. Do it yourself, and prove the answer to yourself. Don't rely on someone else's opinion.

Cheers,

-Cameron McKenzie

 
Lars Behnke
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Method ejbPassivate() is *NOT* invoked by the container when ejbRemove() is invoked (At least this is how BEA Weblogic behaves).

Hence, answer b is correct.
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Check this out, it might be helpful.

JavaRanch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic