openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: Duplicate entry issue with multithreaded application
Date Mon, 24 Sep 2012 16:40:48 GMT
I'm pretty busy so I'll try to help where I can.

> Is there any facility to control what happens in JPA when a unique key
constraint is violated?
No, you can catch the PersistenceException and handle the rollback
accordingly.

What isn't clear to be is why this is happening. Does this exception only
happen on the first request, then it works fine on all subsequent requests?

I noticed that you're calling directly into OpenJPA APIs to mark fields
dirty[1]... that smells a bit odd to me. I don't know if it is related to
the issue you're emailing here, but it seems a bit odd...



[1]  com.cambridgesemantics.anzo.relationalreplicator.openjpa.OpenJPAHelper.
markFieldsAsDirty(OpenJPAHelper.java:110)

On Mon, Sep 24, 2012 at 10:01 AM, garpinc <garpinc@yahoo.com> wrote:

> This is my last major issue which I hope to resolve today.. Is there any
> facility to control what happens in JPA when a unique key constraint is
> violated? Rather than have the whole transaction rollback I'd just like it
> to get the existing record instead and move on...
>
> Rick any ideas here?
>
>
>


-- 
*Rick Curtis*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message