• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB Question?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Check this out, it might be helpful.

JavaRanch
 
reply
    Bookmark Topic Watch Topic
  • New Topic