Alternate get and lock api

Hello,

Existing getAndLock API write locks the document. What I need is a getAndLock that throws something like DocumentLockedException on a second getAndLock call until unlock is called or expiry.

Is there a way to do this? Thanks for your reply.

With much gratitude,
Neome Web

Hi @Neome_Web,

Which SDK are you using? Go, PHP, Java, etc?

Java SDK. But I figured that instead of using getAndLock, I can use the “insert” document with TTL to do the master selection between distributed processes.

I was trying getAndLock to do the same thing.