• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

HFEJB pg 371: question about ejbRemove (q#16)

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

The question 16 on page 371 is: Which additional method(s) might the container call when invoking ejbRemove ?

The answers according to the book is ejbLoad() and ejbActivate().

I was thinking only ejbLoad(). I checked the spec pg.176 and for ejbRemove it doesn't mention anything about ejbActivate().

So what is the correct answer. Why would ejbActivate be called ?

Thanks,
Krishnan Kannan
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because there is a possibility that bean is in the pool. ejbLoad cannot be called on a bean in the pool. So, ejbActivate will be called before ejbLoad in this case.

Please see the life cycle diagram in page 320 of HFEJB for more clarification.

Thilina
 
Krishnan Kannan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply Thilina.

When I look at the lifecycle diagram on pg 320, 321 on HFEJB, it doesn't convey the meaning of ejbActivate getting executed when ejbRemove is called.

Nevertheless, I can see your point where the bean is in the pool and when ejbRemove is called, it gets activated, loaded and then removed. Seems like these are unnecessary activites during removal.

Thanks,
Krishnan Kannan
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic