• 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
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

ejbFind and bean state change

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all
The EJB Specs (age: 169) state this
"The instance does not move to the ready state during the execution of a finder or a home method."
That means a bean remains in the pooled state even after ejbFind is called. In that case, how does the bean serve the business methods of the client ? Will ejbActivate get called for the first business method call, to move the bean to ready state ?
Thanks
Vipin
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vipin Mohan:
hi all
The EJB Specs (age: 169) state this
"The instance does not move to the ready state during the execution of a finder or a home method."
Will ejbActivate get called for the first business method call, to move the bean to ready state ?
Thanks
Vipin


You got it. The job of a finder is JUST to return a primary key (or a collection of primary keys... which then become EJB object references for the client) *without* going to the trouble of allocating a bean and populating its persistent fields with data from the persistent store (i.e. database).
The server doesn't want to waste anyone's time loading beans when the client *might* not ever use the references it "found".
But you're right, as soon as the client calls an actual business method on one of the component interfaces it got back, the server says, "Oh, I guess this client is SERIOUS, so NOW we have to move a bean out of the pool and call ejbActivate() and ejbLoad()...)"
Unless it's a Home business method, of course. In which case the bean still stays in the pool, since a Home business method is not invoked on any specific entity. Home business methods are the same as finders, in terms of not causing a state change in the bean.
cheers,
Kathy
 
reply
    Bookmark Topic Watch Topic
  • New Topic