Question
Tata Consultancy Services
IN
Last activity: 30 Jun 2022 3:03 EDT
Optimistic Lock behaviour When end User and Pega Service updating same work object at same time
Optimistic Locking Issue
I am facing issue with optimistic locking,
when the user is having lock on the case and parallelly when Pega Service is trying to update the same work object it is getting error that other requestor is having lock though on Case type locking is defined as optimistic
Also, i have seen on case type that for optimistic locking there is no soft lock
@SONIA ARORA
When a user opens an assignment on any instance of the casetype configured with optimistic locking, lock on the work object is not acquired then. Instead a lock is acquired when a user submits the assignment. The lock is held till the case processing is completed. Usually case processing doesn’t take long as there is no manual intervention.
In your case, I think Pega service and case processing are trying to update the work object at the same moment and resulting in this issue. If that’s the case a simple solution is to use retry mechanism in your Pega service.
P.S Lock on a case is acquired so that concurrent updates don't happen(which may cause inconsistent case data).