Exception Handling in EJB Transactions. 2004-02-24 - By Vineeth Varghese
Back Hi Basava,
I don't think making your Application Exception a runtime exception is a good idea. The idea of having a Application level exception is to give the user a chance to recover.
Assuming that your are using CMT use setRollbackOnly to rollback your transaction.
Cheerio, Vineeth
Basava Rajesh wrote:
>Hi, > The EJB 2.0 specification states that if an EJBException is thrown, >the container shall rollback the transaction while for Application level >Exceptions, the container does not. But since EJBException is a >RuntimeException(and thus is not checked), should the Application Exceptions >thrown in the Data/Business layer extend EJBException?? Or do we catch the >Application Exceptions and do a manual context.setRollbackOnly(). > > What would be the best way to handle rollback of Transactions when >Application Exceptions are thrown? >TIA, >Rajesh. > >==================================================================== >Companion Site: http://www.corej2eepatterns.com >J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns >List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html >Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) > > >
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|