Joined: Fri Sep 03, 2010 6:27 pm Posts: 8 Location: Munich
|
Hibernate (3.4.0 GA) is used in a rich client application with concurrent client instances. A persistent entity A has an associated child collection C. Version fields are used for optimistic locking. When a child object is modified the version of the parent object in A is not altered which seems ok. To decide if an object graph is still valid before changes are made and attempted to be saved a version check is performed using session.lock(objectA, LockMode.READ) which works fine for the parent objects. A StaleObjectException is thrown when ObjectA has been updated by another instance. According to the Hibernate documentation LOCK should cascade to associations when CascasdeType=LOCK is configured for this association. Unfortunately this seems not to work. No StaleObjectException is thrown when an associated object had been updated. Is this a bug or am I missing something? Any help is appreciated.
|
|