openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim McConnell <>
Subject Optimistic Locking question
Date Fri, 20 Feb 2009 06:41:26 GMT
Hi, I'm a little confused about the OpenJPA optimistic locking behavior relative 
to the flush() and commit() methods. For example, if I modify an entity (which 
contains a version) in one transaction, do an em1.flush(), and modify the same 
entity in another transaction, and do another em2.flush(), I would expect to see 
an OptimisticLockException on the second flush. This does in fact happen like 
this on the Derby database, but not on any other databases I've tried. So, I'm 
wondering if I should instead expect the OptimisticLockException only when the 
transaction(s) end via the commit(), and not on the flush() ??

Tim McConnell

View raw message