my dog learned polymorphism*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes mock exam question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "mock exam question" Watch "mock exam question" New topic
Author

mock exam question

Rajesh Srivastava
Greenhorn

Joined: May 14, 2004
Posts: 25
Hello everyone

The following question is from www.ejbcertificate.com (Client view of a session bean - 4/10)

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.


The answers given are 2 and 5. But I think that answers are 2, 3 and 4.
Reason - Page 62 of specs reads - The EJBHome.remove(Object primaryKey) and the EJBLocalHome.remove(Object primaryKey) methods result in javax.ejb.RemoveException if called on a session bean.
Is this correct or is there something else which I haven't noticed.
Navin T
Greenhorn

Joined: Jul 12, 2002
Posts: 4
Yes Rajesh, I believe that you are right. A RemoveException will be thrown if a "remove" is invoked on a session bean's EJBHome


SCJP, SCWCD, SCBCD
Rajesh Srivastava
Greenhorn

Joined: May 14, 2004
Posts: 25
Thanks for confirmation
Terry Martinson
Ranch Hand

Joined: Oct 18, 2003
Posts: 293
See also p. 559 Head First EJB.
The second scenario on this page deals with answers 3 and 4 and also confirms what you are thinking.

TJ


SCJP, SCJD, SCWCD, SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mock exam question