Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock exam question

 
Rajesh Srivastava
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Rajesh, I believe that you are right. A RemoveException will be thrown if a "remove" is invoked on a session bean's EJBHome
 
Rajesh Srivastava
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for confirmation
 
Terry Martinson
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic