• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Exception-Doubt

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need some clarifications regarding exception exercise from HFEJB PGNO:547.

Given Options:
A. Throw an EJBException
B. Throw a RemoteException
C. Invoke setRollbackOnly()
D. Allow the exception to propagate.

Scenarios:

1. You catch a checked exception in your ejbActivate method. The method is not in a transaction.
Ans: I think we cant throw any checked exception from ejbActivate(and some other container callback methods), the option would be A.

2.A DivideByZero exception occurs as your business logic is running. You do not have a try/catch for this.
Ans: A/B

3.You throw a CreateException from your ejbCreate() method and you realize that you probably cannot safely complete your transaction
Ans:C,D

4.You catch a Checked exception in a business method and realize that your bean is probably corrupt.
Ans:C,D

Please correct me if iam wrong in any of the scenarios.

Thank you
 
vinod balaji
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
I didn't say it. I'm just telling you what this tiny ad said.
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic