Issue
When processing that is invoked by an agent executes DefineSLATimes or pxAdjustSLATimes, a Lock already held error occurs.
Symptoms and Impact
- Lock already held error occurs
- In some scenarios, an additional SLA queue item is created.
Steps to reproduce
- Create a process which invokes DefineSLATimes or pxAdjustSLATimes to update an SLA queue item.
- Invoke this process within the context of an agent, such as the ServiceLevelEvents agent or a custom agent.
Root Cause
This behavior is due to a known limitation within the Pega Platform, where an agent can only obtain a lock on a single queue item at a time.
Solution
When this behavior occurs within the ServiceLevelEvents agent, and the SLA queue item being updated by DefineSLATimes or pxAdjustSLATimes is the same queue item that is being processed by the ServiceLevelEvents agent, this error does not halt processing and can be ignored.
For custom agents, or for scenarios where the SLA queue item being updated by DefineSLATimes or pxAdjustSLATimes is not the same queue item being processed by the ServiceLevelEvents agent, this error can be avoided by leveraging Queue processors instead of agents, as the limitation is not present for queue processors.
For more information, refer the following documents: