Okay, reading the manual sometimes helps... ;-)

Increasing the version on all children is OpenJPA default:

/This lock manager does not perform any exclusive locking, but instead
ensures read consistency by verifying that the version of all read-locked
instances is unchanged at the end of the transaction.
Furthermore, a write lock will force an increment to the version at the end
of the transaction, even if the object is not otherwise modified. This
ensures read consistency with non-blocking behavior.

This is the default openjpa.LockManager setting in JPA.
/
This setting can be overriden by using the pessimistic lock manager and its
properties:

/The pessimistic LockManager can be configued to additionally perform the
version checking and incrementing behavior of the version lock manager
described below by setting its VersionCheckOnReadLock and
VersionUpdateOnWriteLock properties.
/
So I configured OpenJPA to not change the version on update:

<property name="openjpa.LockManager"
value="pessimistic(VersionCheckOnReadLock=true,VersionUpdateOnWriteLock=false)"
/>

But it does not work. The version fields of all children are still
incremented. Do I miss something? What do I have to configure in order to
have OpenJPA update the changed entities' version field only?

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Version-of-all-children-is-incremented-in-OneToMany-when-merging-parent-entity-tp6645128p6648304.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to