We have implemented ‘CAS based optimistic locking’, that sounds very much a mix of Optimistic and Pessimistic resource locking.
Is there any way to implement only Optimistic lock only on Document?
We have implemented ‘CAS based optimistic locking’, that sounds very much a mix of Optimistic and Pessimistic resource locking.
Is there any way to implement only Optimistic lock only on Document?
Hi Naveen,
Sure, to do optimistic locking you:
If this is what you’ve already implemented, then congrats, you’re doing it right
Thanks,
David
Hi David
All three mentioned steps are the same in my implementation except when I’m reading Document using getAndLock(). I suppose, if I want to implement only Optimistic lock, I should use get() only instead of getAndLock()
Regards,
Naveen