Locking and exceptions

Hi,
I see similar error when I try to access a locked document. I am looking to see if there is a way couchbase can tell that the document is locked instead of throwing exceptions. If I want to perform a lock check on a document before I can actually lock it, I do not want to use generic time out exception to assume the document is locked. According to Couchbase documentation, it should be a Locked error.

Below is the exception that is thrown when erforming a GetAndLock on an already locked doc.
Couchbase.Core.Exceptions.UnambiguousTimeoutException: The operation 130/crl…6b8dffe8-12f7-40f3-a820-92c08751da24 timed out after 00:00:00.0917075. It was retried 11 times using Couchbase.Core.Retry.BestEffortRetryStrategy.
at Couchbase.Utils.ThrowHelper.ThrowTimeoutException(IOperation operation, IErrorContext context)
at Couchbase.Core.Retry.RetryOrchestrator.RetryAsync(BucketBase bucket, IOperation operation, CancellationTokenPair tokenPair)
at Couchbase.KeyValue.CouchbaseCollection.GetAndLockAsync(String id, TimeSpan lockTime, GetAndLockOptions options)

NOTE FROM ADMIN: This was a reply to a very old thread, so I moved it into a new one. Here’s the old one for reference: Getting timed out error from GetAndLockAsync method - #4

Which SDK and which version? (Looks like the .NET SDK and perhaps version 2.4?)
And the link for the doc.

If I want to perform a lock check on a document before I can actually lock it,

Why not just attempt to lock it? Then you’ll know if it is locked or not. If you want it to fail immediately, then FastFailRetryStrategy will do that.

Thanks.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.