Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Disable/Enable Optimistic Locking

411395Feb 16 2004 — edited Feb 16 2004
Our application has the option of forcing and update to an object even though the object has been changed be another user (i.e. I don't care if this overwrites another user's data, save it anyway)

The default mode for the application is the set an optimistic locking poilcy on all relevant objects, but I'm not quite sure what the recommended procedure for "forcing updates" is.

I would just set the optimistic locking policy to null, but I fear that it applies to all instaniated objects of that type and this would not have the desired effect (i.e. simultaneously, one users tries to force an update while another user tries to just save, expecting to see any conflicts. It is bad if before the locking policy is turned back on, the second user is allowed to save his data w/o an OpLock exception). However, this is just a theory - maybe this is the recommended way to disable locking?

Another approach is to just trick toplink by updating the timestamp or changing the version so that it matches the most recent version. Is this a valid approach?

What is the recommended way to toggle optimistic locking during runtime?

--shawn
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2004
Added on Feb 16 2004
3 comments
617 views