-
1. Re: Transactions and exceptions
bartman Mar 27, 2002 10:35 AM (in response to onkalich)I think the answer to this question has to be no -- you have to extract the wrapped exception from the remote exception even if the exception thrown extends RemoteException. It's a little annoying but not the end of the world. Don't assume that this is the gospel truth by any means: it's just what I've observed in my experience.
Bart -
2. Re: Transactions and exceptions
pazu Mar 27, 2002 11:19 AM (in response to onkalich)You should *not* extend RuntimeException. Your app exceptions should descend from Exception or any other non-runtime exception you wish.
If you exception extends RuntimeException, it will be wrapped in a EJBException and the client will be unable to catch it. -
3. Re: Transactions and exceptions
onkalich Apr 2, 2002 2:43 AM (in response to onkalich)When I tried to create application exception , the container did not catch the exception and roll back the transaction. As I looked at the code , the container catch only Runtime and Remote exception.
-
4. Re: Transactions and exceptions
bartmann_d Apr 2, 2002 3:06 AM (in response to onkalich)That's because the container behaves according to the EJB spec! An application exception should not automatically lead to a rollback. If you want your bean to do so you have to explicitly set the rollbackOnly flag.