These questions are from HFE
1.which are legal declarations for a CMP bean's ejbCreate methods
A.public void ejbCreateBigCustomer() throws javax.ejb.CreateException
B.public
String ejbCreateAccount() throws javax.ejb.CreateException
C.static String ejbCreate() throws javax.ejb.CreateException
D.public int ejbCreate() throws javax.ejb.CreateException
E.public final String ejbCreate() throws javax.ejb.CreateException
I know A,C,E cannot be the answers.But why D cannot be the answer.For entity beans ejbcreate method returns a PrimaryKey.int can also act as a primarykey.
2.which method(s) from the EntityContext interface can be invoked from with in the ejbCreate method?
A.getEJBHome()
B.getEJBObject()
C.getCallerPrincipal()
D.getUserTransaction()
E.setRollBackOnly()
MyAnswers:A,C,E
Answers according to HFE:A,B,C,E
My doubt is how can B be the answer.Is it legal to call getEJBObject() from ejbCreate() of an entity bean.
container is not aware of the primarykey until the ejbCreate() returns.Then how can it prepare an EJBObject for the client,and how can we call getEJBObject();
3.which method(s) run in the transaction context of the method that causes their invocation?
A.ejbLoad()
B.ejbRemove()
c.ejbSelect()
D.ejbActivate()
E.ejbPassivate()
F.setEntityContext()
HFE Answers:A,B,C.
can any one please give the reason behind it.
thanks in advance
srinija