.NET client getWithLock



i’m trying to use getWithLock function implemented in 1.2 client. i do it in a way that i’m trying to obtain value from couchbase for 5 seconds (in while loop), when i get it i update it and store, when not then i log it and leave.
what i observed is that in normal traffic it’s ok, everything works fine, anyway as soon as the traffic grows i start seeing log saying that i cannot get locked value from couchbase especially in situations when the writing queue has more than 0 items.
my question is - does locking works on the couchbase cache layer also or it works just on written (and physically stored data) ?




The getWithLock works with the caching layer. ( http://www.couchbase.com/docs/couchbase-devguide-2.1.0/get-and-lock.html )

Also as a generic best practice it is always better to use a CAS approach instead of a lock: