-->
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: Can I disable version checking when flushing a session?
PostPosted: Wed Aug 30, 2006 10:41 am 
Newbie

Joined: Mon Jul 24, 2006 2:23 pm
Posts: 3
I have a question about StaleStateException and optimistic locking that I can't seem to find answered in the documentation. I want to know if there is a way to declare a class with a version attribute, so that it will throw a StaleStateException if the version check doesn't match, but retain the ability to ignore the version check when appropriate and let the update go through regardless of whether it trashes some other thread's changes to the object.

The reason for this is that I am migrating a legacy application, and the existing behavior is to detect the update collision, warn the user, and then ask them if they really want to go ahead with the update even though someone else has modified the object. If the user chooses to trash the other person's changes, so be it -- we do the update.

I would like to use the optimistic locking that hibernate provides to detect and prevent lost updates, but I need to be able to force an update when I have to, even if my object is stale.

Is there a provided technique for this, or am I stuck implementing the optimistic locking in the application layer?


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.