Forums Register Login

ejbFind and bean state change

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
 

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
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 726 times.
Similar Threads
Moving Entity Bean From Pooled to Ready State--help.
Missing link in entity bean finder methods !
EJB QL: Difference between find and select methods
Regarding Ejb Select method
what is the difference between finder and select methods?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:27:21.