posted 19 years ago
Hi,
ejbCreate is not true for all beans, for entity beans, ejbCreate is called when a user calls for a finder/Create method, container takes one bean FROM the POOL, then calls its ejbCrate method to make it the OO view of the required entity. IT's not called when the bean is created.
ejbLoad is obviously not correct.
ejbHome is a container callback for home biz method invocation; takes an existing bean out FROM pool.
ejbFind is obviously wrong too.
The only one being called just before the bean starts existing and goes to pool is getEntityContext. This is only for entity beans, it's true, but the question does not specify it must apply to any kind of bean. And anyway it's the only possible answer.
I know what you think. "About ajbCreate, this silly guy told me it was not true for all beans, but now he says the question does not specify it must be for all beans".
You're right, I'm silly, but I'm right. The difference is that the question DOES say that the method MUST takes a bean from DNE state to POOLED state. For the ejbCreate, it's true for some cases, but there is some cases where ejbCreate does NOT do what we want here : entity beans. So you cannot say ejbCreate method takes a bean from DNE to P, because sometimes it does not.
In the other hand, the setEntityContext may be used only for EB, but the point is you CANNOT find a case where setEntityContext does NOT takes an EB from DNE to P state.
I hope I'm clear. This is a question understanding problem, which in some cases is quite tricky. The only solution is to read carefully the question and think about its meaning.
[ March 29, 2006: Message edited by: Frederic Esnault ]
[ March 29, 2006: Message edited by: Frederic Esnault ]
SCJP 5 - SCWCD 1.4 - SCBCD 1.3 - Certification study documents/resources: http://esnault.frederic.free.fr/certification