• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Sharpen your pencil page 547

 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone have the answers for this exercise ?
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was also looking for some "answers" to this Sharpen your pencil so lets continue this thread that was a good start: Kathy need your help -> Sharpen Your Pencil pg:547

I mostly agree in the answers suggested of Agasthya Iyer except for number 4 where B.Sathish has argumented very good for why it should be option A. I first answered C and D assuming that the checked exception is declared for the business method but after have read the arguments from B.Sathish do I fully agree in that it should be answer A.

But for the first one am I not sure. If the caught exception is not one that is declared or one that is an exception from a lower level, then is answer A the one that is correct. But if it is an exception that is declared for that method, would it then not be more correct to answer D and let the client know what went wrong? And they do not say that the bean is probably corrupt in the first scenario. I assumed that the exception is declared for the method and answered D. But comments to this would be appreciated!

[ June 23, 2007: Message edited by: Jonny Andersson ]

[ June 23, 2007: Message edited by: Jonny Andersson ]
[ June 23, 2007: Message edited by: Jonny Andersson ]
 
Celinio Fernandes
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You catch a checked exception in a business method, and realize that your bean is probably corrupt.

Answer B: throw a RemoteException.

Do you agree ?
 
Jonny Andersson
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


You catch a checked exception in a business method, and realize that your bean is probably corrupt.
Answer B: throw a RemoteException.
Do you agree ?



No, I don�t ... because you never throw a RemoteException from a bean. Instead you throw an EJBException which become a RemoteException if the client is remote and is delivered as is, as an EJBException, if the client is local. And with the EJBException that is a system exception do you also get rollback from the container without have to do it yourself explicitly as B.Sathish said in his post at https://coderanch.com/t/161347/java-EJB-SCBCD/certification/Kathy-your-help-Sharpen-Your
reply
    Bookmark Topic Watch Topic
  • New Topic