openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From susanne_j <susann...@gmx.de>
Subject Re: Problem with the optimistic locking id after a unique constraint violation exception
Date Tue, 22 Oct 2013 12:14:03 GMT
Hello Rick,

thanks for your answer!

I found a solution for my problem.

1.) detach the object from the entity-manager
2.) make a deep-copy from the entity structure
3.) open a new entity-manager
4.) merge the deep-copy into the new entity-manager
5.) do the update with try-catch and so on (and display the error to the
user in case of an exception)
6.) commit and close the new entity-manager

In case of an error, I can merge the detached object again into the former
entity-manager and have it back.
In case of a success of the update I don't need the detached object
anymore...

Seems currently to work for my needs.

Best regards,
Susanne.



--
View this message in context: http://openjpa.208410.n2.nabble.com/Problem-with-the-optimistic-locking-id-after-a-unique-constraint-violation-exception-tp7585160p7585299.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message