You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Marko Asplund <ma...@gmail.com> on 2007/12/02 18:10:58 UTC

Re: How do I distinguish different types of exceptions in openjpa

Gul 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 ?

I've found it sometimes useful to use Spring framework for mapping the
database exception to the Spring DAO exception hierarchy so that the root
cause can be determined in a database independent fashion:

http://static.springframework.org/spring/docs/2.5.x/reference/dao.html#dao-exceptions



marko