Couchbase Java getAndLock confusion

fkmylife

New Member
I have two questions. I have a multithreaded Java application. What happens when a thread calls getAndLock on a key, and immediately after that another thread calls getAndLock on the same key?[*]Will the secondthread automatically wait until the first thread has released thelock? Or, will it return with a null CAS value? Or, will it throw anexception?[*]If the first thread deletes the key (the whole document), what will happen to thesecond thread?
 
Back
Top