Hello Pinaki,

thank you for your answer, I've tried it this way and it works.

I'd say its historically grown to use a separate entity. Could you give me 
some advice on how to implements database locks with openJPA? I would have 
to lock a certain amount of rows in different tables and react on the lock 
from the application (tell the new user WHO is currently working with the 
entity, including a timeout of the lock after x minutes). I'm unsure if 
there is a way to do this with database locks.

Thank you,

Heiko




ppod...@apache.org 
22.09.2011 18:46
Bitte antworten an
users@openjpa.apache.org


An
users@openjpa.apache.org
Kopie

Thema
Re: OpenJPA 1.2: EntityExistsException on em.persist() for Entity that is 
no longer present in DB






Hi Heiko,
  Instead of creating/deleting LockEntity, have a boolean state field
isLocked. 
  Set/unset it as the application logic demands
  always flush on mutation
  always refresh on access.

  But why a separate entity, why not using database locks itself?


-----
Pinaki Poddar
Chair, Apache OpenJPA Project
--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-1-2-EntityExistsException-on-em-persist-for-Entity-that-is-no-longer-present-in-DB-tp6819702p6821041.html

Sent from the OpenJPA Users mailing list archive at Nabble.com.



If you are not the intended addressee, please inform us immediately that you 
have received this e-mail in error, and delete it. We thank you for your 
cooperation.  

Reply via email to