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

RemoveException, CreateException, FinderException and EJBException

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is CreateException, FinderException, RemoveException and EJBException applicable to their respective methods? Say CreateException is thorwn when problems in creating a bean instance and finder when canno find bean due to (maybe connection or sql error) etc. RemoveException when ejbRemove encounter problems and EJBException when business methods cannot succeed? In sun tutorial all methods throw EjbException which confused me. Could someone shed some light on this issue please?
Thanks a lot
Rastin
 
Author
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJBExcpetion is a runtime exception so you do not have to declare it in the throws clause. (It is also a wrapper exception....)
The tutorial is wrong. Doing such will cause the verifier in deploytool to declare this as an error.
All system exceptions are runtime exceptions in EJB. If you the container encounters a system exception, it will automagically role back the current transaction.
CreateException and RemoveException are application exceptions (non system, i.e., non runtimes). If the container encounters them, it will not automagiacally role back the current transaction.... it is up to the client if the transaction context gets propagated that far to handle the exception and roll back the transaction if needed.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic