I am seeing intermittent document unlock issues with Pessimistic locking approach. I am using below strategy to lock-unlock a document:
- Use getAndLock with a lock timeout (3 sec) to lock a document and get CAS value.
- Make modifications to the document and use replace with above CAS value to replace the document.
This approach mostly works and replace operation releases the lock on the document. But occasionally replace does NOT release the lock and any subsequent getAndLock fails to acquire the lock and throws TemporaryLockFailureException. Even the explicit ‘3 sec’ timeout does not release lock.
Is there a known issue or scenario when this can happen ?