-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Concurrency issue: CascadeType.LOCK not working as expected
PostPosted: Tue Jan 03, 2012 6:01 am 
Newbie

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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.