... Unless your db has deferred constraints or uses optimistic locking
internally to maintain db locks, in which case the flushed tx may
still a
fail.

-Patrick

On 12/2/07, Craig L Russell <[EMAIL PROTECTED]> wrote:
> 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!
>
>


-- 
Patrick Linskey
202 669 5907

Reply via email to