• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJBCertificate wrong answer

 
Mina Syal
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

They answer 2 and 5. And I answered 2,3 and 4.


As per specs correct answers are 2,3 and 4.

directly from specs...

1- javax.ejb.EJBHome.remove(Object primaryKey) method on a session results in the javax.ejb.RemoveException.

2- javax.ejb.EJBLocalHome.remove(Object primaryKey) method on a session results in the javax.ejb.RemoveException.

3- The EJBObject.getPrimaryKey() method results in a java.rmi.RemoteException.

4- The EJBLocalObject.getPrimaryKey() method results in a javax.ejb.EJBException.

Am I right?

Please clarify.

Thanks,
Mina.
 
Nitin Mehhta
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes absolutely. I think you had posted a similar query sometime back. It is some how confusing and the array of wrong answers given add to the woes. For most of the people using the HF book a further reiteratement could be found at page 130 and page 559 -> second scenario.
 
Nitin Mehhta
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding to this confusion the same book at page 550 says that a Stateless Session Bean can never have RemoveException. Which I feel though in the context of the discussion (in the book) is relevant, but still it is incorrect. At that time probably the author wants to communicate that we cannot get a RemoveException from the component interface of the Stateless Session Bean. Please do correct me if my assumption is wrong.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic