[hibernate-dev] Hibernate ORM 4.1.1 release - Undocumented behavior change in Optimistic Versioning ?

Demetz, Guenther Guenther.Demetz at wuerth-phoenix.com
Fri Mar 9 04:04:54 EST 2012


Hi hibernate developers,

testing Hibernate ORM 4.1.1 I discovered a behavior change regarding Optimistic Lock Versioning
in detail on bidirectional OneToMany relations with inverse-owner (mappedBy attribute specified):

- until Hiberante version 4.1.0 by default on changes both involved sides got a version increment 
- now with Hiberante4.1.1 only the owner-side (=the Many-side) gets a version increment.

To make the thing working as before, 
now on such relations we must define explicitly OptimisticLock.excluded=false 

@javax.persistence.OneToMany(mappedBy = "parent")
@org.hibernate.annotations.OptimisticLock(excluded=false)
@javax.persistence.MapKey(name="field1")
private Map<String,Child> aggChild = new java.util.HashMap();

Was such behavior change intended?
I looked at the 28 issues which had been fixed with Hiberante4.1.1 but found nothing in regard,
maybe I overlooked something ?


Würth Phoenix S.r.l.
Günther Demetz
Via Kravogl 4
I-39100 Bolzano 
E-Mail:     guenther.demetz at wuerth-phoenix.com
Website:  www.wuerth-phoenix.com






More information about the hibernate-dev mailing list