posted 21 years ago
hi Mark,
I am trying to answer your question, please correct me if I am wrong.
The answer to the question is, 'a' and 'b'.
The reasons are,
Why D is an incorrect choice,
1. The entity bean is a CMP entity bean.
2. For CMP bean, the container handles the persistance of the data and ejbStore()(and also ejbLoad()) method/s are called by container (callback methods) to give the developer , some chance to do some work before persisting or after reading the data.
3. The life cycle events will be(considering the question),
entityBean.ejbActivate()---> entityBean.ejbLoad()---> entityBean.businessMethod1()---> entityBean.businessMethod2()----> entityBean.ejbStore()---> and then(container will extract the persistant fields from bean instance and will write to DB) ----> entityBean.ejbPassivate()
If the entity bean is a BMP, then answer 'D' is correct.
Why 'a' is a correct choice,
1. If the business methods were marked with 'RequiresNew' Tx attribute, the container would have started a new transaction for each business method while suspending the client's(the session bean's transaction); and what has mentioned in option 'c' would have happened.
So the business methods are not marked with 'RequiresNew' Tx attribute and hence 'a' is true.
Thanks,
Manish