Hi Gul,

If you execute a JPA method, the JPA exception thrown should be able to be caught directly.

But if you're using a framework API for example to complete transactions via UserTransaction, then the exception is not directly a JPA exception but a framework exception.

To get a JPA exception for these cases, you can try flush() which will stimulate OpenJPA to try to flush the changes, leaving only the commit itself for the framework. And if flush succeeds, and commit fails, then you have a framework issue not an OpenJPA issue.

Craig

On Nov 29, 2007, at 8:47 AM, Gul Onural wrote:


When a database error occurs in the openjpa, I always get rollback
exception. For example if there is an error
because of a duplicate record creation attempt, I still get rollback
exception.

Is there a way to inspect the exception to see the root cause ?

Gul

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to