Hi SCEAs
I have doubt in certain questions and need clarifications for certain questions mentioned in one of the mock
test 1. In EJBs, Which two callback methods can be used for synchronizing the bean's state with the database
a. ejbStore() and ejbLoad()
b. ejbActivate() and ejbPassivate()
c. ejbStore() and ejbPasivate()
d. ejbLoad() and ejbActivate()
Given answer is b) but i think answer should be a) --Please need clarification.
2. When does an Entity Bean transition from Pooled State to Ready state
a. when create() is invoked on EJBHome
b. when a find method is invoked on EJBHome
c. when a BEan is activated by the container
d. when a BEan is passivated by the container
Given Answers are a), b), c)
My comment:- Invoking find method does not move the
EJB pooled state to ready state . Answer c is wrong . Snippet from EJB 2.0 Specs
"The instance does not move to the ready state during the execution of a finder or a home method".
3. When is ejbStore() invoked?
a. Immediately before the container reads the Bean's state information.
b. Immediately after the containter reads the BEan's state information
Given Answer is a)
4. When is ejbLoad() invoked?
a. Immediately before setting the Bean's state information.
b. Immediately after setting the Bean's state information
Given Answer is b
Can any one give explanation for questions 3 and 4