Thank you Steve,

anyway in this context 
I strongly recommend all Hibernate-Users to force version increment explicitly 
on such OneToMany relations when the mapped collection is a map!
Otherwise, unless implementing some pessimistick locking, 2 concurrent 
transactions will be able to insert an object in the map, each indipendently 
from the other, using the same key value, without getting any exception at 
flush or commit time.
This leads finally in having 2 records persisted on database whilst in 
hibernate (due the constraints of the map) on successive accesses you always 
will see just one. This is quite dangereous.

regards
G.D.

_______________________________________________
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

Reply via email to