This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt on finder methods

 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • 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,
 
Awishek sinha
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic