• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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
 
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic