1.Which of the following statements regarding session beans are true? [Check all correct answers]
1. Invoking javax.ejb.EJBObject.getPrimaryKey() on a session bean results in javax.ejb.EJBException been thrown.
2. Invoking javax.ejb.EJBLocalObject.getPrimaryKey() on a session bean results in javax.ejb.EJBException been thrown.
3. Invoking javax.ejb.EJBHome.remove(java.lang.Object primaryKey) on a session bean results in javax.ejb.RemoveException been thrown.
4. Invoking javax.ejb.EJBLocalHome.remove(java.lang.Object primaryKey) on a session bean results in javax.ejb.RemoveException been thrown.
5. Invoking javax.ejb.EJBHome.remove(java.lang.Object primaryKey) on a session bean results in java.rmi.RemoteException been thrown
my answers:2,3,4.
given answers:2,5
I have a doubt about the exceptions we get when we call remove on the Home interface.
In HFE page:559 it was clearly stated that client gets a Remove exception regardless of client being a remote or local one.
But in some mock exams it was given that client gets Remote Exception
which one is the right answer?
2.Which of the following statements are requirements for a session bean's session bean class? [Check all correct answers]
1. The class must implement the javax.ejb.SessionSynchronization interface.
2. The class must implement the javax.ejb.SessionBean interface.
3. The class may implement the session bean's component interface.
4. The class can be declared final.
5. If the class is a stateful session bean, the constructor must declare parameters to initialise the session state
Myanswer:2
Given answers:2,3
how can 3 be the right choice.can any one explain it?
thanks in advance
srinija
SCJP 1.4,SCWCD 1.4