• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Doubt on finder methods

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Can anybody explain me influence of finder methods on life cycle of entity beans?
Where the finder methods come into picture in lifecycle?
What happens in the background when a client invokes a finder method?


Thanks and Regards,
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gowda
Finder methods in entity bean does not have any influence on its lifecycle.(i.e invoking these methods does not cahnges the state of entity bean)
It can be called on two stages of entity bean lifecycle
1.Polled state
2.Ready state
What happens in the background when a client invokes a finder method?
For CMT bean the bean provider does not have to define these methods in bean class it is implemented by the container from the info provided in the Deployment descriptor using EJB-QL by bean provider.So when the client calls this finder method the container invokes this implemented method to give back the result.
For BMT bean the bean provider has to write the finder method in the bean class.
Let me know if it clears your doubt.
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Awishek,
I want to know what happens when the client calls finder methods? How does container pulls beans out of pools and assign them task of finding a given primary key?

Thanks and Regards,
 
Awishek sinha
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gowda
let me tell my understanding..
The container does not pull the bean instance out of the pool(state cahge does not happens) to execute the finder method, it select one of the bean instance and call the finder method implemented by the container(CMT), and returns the ejbobject having primary key assigned to it( at that time the bean context is not assigned the primary key..)
once the client call the businees method on ejbobject stub then only the primary key may assigned to session context and it represent that entity
It might slightly.. differ from vendor to vendor..
Hope it clears your doubt..
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi awishek,
Thanks for the reply. I overlook page that describes lifecycle of finder methods and create methods in the book.
I got it now.

Thanks and Regards,
 
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic