• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on exceptions

 
Adrian Pang
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPilot question ID 1840:

A client has just called a business method on an entity bean on which another client has already called theBean.remove(). What will happen?

Options

Select 1 correct option.

1. A new entity bean is created and the method is executed on that bean.
2. The method call will return immediately without returning any output.
3. The client will get javax.ejb.EJBException
4. The container will route the call to another container within the cluster (if it exists).
5. The client will get javax.ejb.NoSuchObjectLocalException if it is a local client.

Correct answer is 5.

I know the reason it should be 5, but 3 sounds correct as well -- after all, (if I understand correctly) the container does not have to throw the most specific exception to the user. If I see this question on the exam, I will pick 5 (since it's the best answer) but if the question has 2 answers, would it be wrong to pick 3 as well?

Thanks,
Adrian
 
Prashu Negu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya..i too confused here. Experts, comments please.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.coderanch.com/t/160983/java-EJB-SCBCD/certification/exceptions
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic