Exception handling in ejb3.0
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Manu_Gupta
Posted On:   Sunday, May 17, 2009 08:23 PM

In our application we are using Container Managed Transactions. Before coming out of the method we are doing entityManager.flush() to synchronize with the database. Suppose while flushing we get an exception e.g. optimistic lock Exception we are wrapping it with an appplication exception say recoverable exception and throw it to the client. But at the client end we are receiving ejbTransactionRollbackException and not the recoverable Exception that we threw. It looks like that the container wraps our exception in ejbTransactionRollbackException . Note :Our recoverable exception extends RuntimeEXception. Is it possible to receive customized application exception back from the ejb contai   More>>


In our application we are using Container Managed Transactions.
Before coming out of the method we are doing entityManager.flush() to synchronize with the database.

Suppose while flushing we get an exception e.g. optimistic lock Exception we are wrapping it with an appplication exception say recoverable exception and throw it to the client.

But at the client end we are receiving ejbTransactionRollbackException and not the recoverable Exception that we threw.
It looks like that the container wraps our exception in
ejbTransactionRollbackException .


Note :Our recoverable exception extends RuntimeEXception.
Is it possible to receive customized application exception back from the ejb container?

   <<Less

Re: Exception handling in ejb3.0

Posted By:   Sandeep_Shilawat  
Posted On:   Tuesday, May 26, 2009 09:48 PM

What is Container Vendor? Some vendors rollback container transactions upon user exception. If you are throwing app exception how do you expect container to ignore it?
About | Sitemap | Contact