locking with .NET client
Tue, 10/16/2012 - 05:13
hi,
i'm developing app written in .NET. i'm using couchbase client found here.
what i'm trying to make is
1. to get the object from cache
2. lock it for writes/reads (or at least signalize locking if somebody else gets it)
3. modify it
4. release the lock
is it possible to use clients api to lock the document?
thx
Lubos
Hi Lubos,
Couchbase does offer a get with lock facility that provides pessimistic locking. Unfortunately, it is not implemented currently in the .NET client. You can read more about that feature in the Java docs - http://www.couchbase.com/docs/couchbase-sdk-java-1.0/couchbase-sdk-java-.... I've created an issue for tracking this feature in .NET - http://www.couchbase.com/issues/browse/NCBC-145. I hope to add it after the 1.2 release of the client.
Depending on your use exact use case, you might be able to take advantage of CAS operations, which are optimistic concurrency controls.
http://www.couchbase.com/docs/couchbase-sdk-net-1.1/couchbase-sdk-net-up...
-- John