The version incrementation strategy to prevent concurrent write operations
behaves differently on OpenJPA 1.2.3 and the newest version 2.2.1. Maybe
this is a bug in OpenJPA 1.2.3 but we are not sure.

We created a test project where we can reproduce the difference between the
two OpenJPA versions. The difference shows up when list operations are
executed on a list of children in a one-to-many parent-child relation. If
the parent or a child entity is modified only the parent or child version is
incremented. That's okay. If a child is added to or removed from the list
the version fields of ALL children are incremented using OpenJPA 1.2.3
whereas the parents' version is incremented only using OpenJPA 2.2.1.
Because we use entity callback methods to set usernames and timestamps all
modified user and modified timestamps of all children are updated even
though a user just added a child to the relation. That shouldn't happen
because in our case it has legal consequences unfortunately.

There is another odd thing. The mentioned behavior appears only if the
parent entity is merged.

If the child entity is merged version incrementation behaves like OpenJPA
2.2.1.

Here're our parent and child entities and the entity superclass containing
the version field:



We're using OpenJPA 1.2.3-SNAPSHOT which comes with WebSphere 7.0. Entities
are detached, then modified and sent back to the server again where they are
merged (we use RCP clients).

So please can someone of the OpenJPA team confirm the behavior and issue a
statement that it is not a bug? Otherwise we have to open an APAR at IBM
support as long as we use WebSphere 7.0 production platform. Migrating to
WebSphere 8.5 (OpenJPA 2.2.1) would solve our issue anyway. Thank you!



--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Different-version-incrementation-behavior-or-bug-tp7582703.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to