Following are taken from Muhammad Ashikuzzaman's SCBCDExam Notes. Wish he would include the answers too.
Can someone please provide the answers to the following. Mine are at bottom
SQ1. Which are true about session beans?
A. A client can pass a remote home object reference to another application.
B. The javax.ejb.EJBMetaData interface is intended to allow application assembly
tools to discover information about the session bean, and to allow loose
client/server binding and client-side scripting.
C. The javax.ejb.EJBLocalHome interface defines the method create() which returns
javax.ejb.EJBLocalObject.
D. The javax.ejb.EJBLocalHome interface defines the method remove(Object primaryKey)
which returns null.
Answers:
a, b , c
SQ3. Which are true about session beans? (Choose all that apply)
A. An attempt to remove a session object while the object is in a transaction will
cause the container to throw the
IllegalStateException to the client.
B. A session bean class must not implement the session bean's component interface.
C. A session bean class must not implement the ejbCreate() method.
D. The business methods of a session bean must not be declared as final or static.
E. The remote interface methods must not expose the managed collection classes
that are used for CMP entity beans as arguments or results.
Answers:
a, d
SQ4. Given a CMP entity bean, which of the following statements are correct?
(Choose all that apply)
A. All the exceptions defined in the throws clause of the method of the remote interface
must be defined in the throws clause of the matching method of the enterprise Bean class.
B. The ejbSelect<METHOD>(...) must not be declared as static or abstract.
C. The ejbHome<METHOD>(...) can be declared as final.
D. The return value type of a business method of an entity bean class could be of MyClass defined
as follows:
public class MyClass {
public int result;
public int getResult() { return result; }
public void setResult(int result) { this.result = result; }
}
E. The throws clause of an ejbPostCreate<METHOD>(...) may define
arbitrary application specific exceptions including javax.ejb.CreateException.
F. The bean provider must always define a query for each finder method in the deployment descriptor.
Answers:
d,e,f