MountainClimb / datanucleus-appengine

Automatically exported from code.google.com/p/datanucleus-appengine
0 stars 0 forks source link

JPA: Version field does not increment when object is merged #159

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Original issue here:
http://code.google.com/p/googleappengine/issues/detail?id=2193

Original issue reported on code.google.com by max.r...@gmail.com on 18 Nov 2009 at 11:13

GoogleCodeExporter commented 8 years ago
There is another problem with optimistic locking -- attached objetct dont throws
Optimistic Verification Exception when i try to update already modified 
objetcts. 
For example in one session i got object with version 3,  and get same one in 
other
session. Then i save first object (in db version increments to 4) and then save
second object, in db version becomes 5 and there is no exception throws.

Original comment by ligr...@gmail.com on 19 Nov 2009 at 8:29

GoogleCodeExporter commented 8 years ago
The original example shows the correct behavior.  After a merge the detached 
object
should _not_ have an updated version property but the copy of the detached 
object
returned by the merge.  If you change

em.merge(hv);

to

hv = em.merge(hv);

The test passes.  I've verified that the behavior is the same with the 
DataNucleus
RDBMS plugin.  I'm marking the issue invalid.  I know there is an additional 
report
tacked on to this issue but the reporter never followed up with the details I
requested.  If the other problem still exists please file a separate bug with 
sample
code demonstrating the problem.

Thanks,
Max

Original comment by max.r...@gmail.com on 24 Apr 2010 at 11:50