We are using optimistic locking for our case type. The case type instances are update by Job scheduler and most of times this works fine.
But sometime we saw Database-LockFailure-LockHeldByAnother error message and Job scheduler tried to open and update case intances. Below is sample of error message.
Exception in executing Job[SampleJob]com.pega.platform.executor.jobscheduler.scheduler.JobExecutionException: Job Scheduler [SampleJob] activity [SampleActivity] execution marked as failed with message [Cannot obtain a lock on instance AAA-MyCo-WORK P-97037, as Requestor BHO7NM28D640ZRADZR7UI3OGTA8WFVR23A already has the lock].
In my understanding System-Locks records are not created for optimistic locking and Database-LockFailure-LockHeldByAnother error should not be happened for optimistic locking.
Is my understanding correct?
@Hongte , it’s unlikely that you would encounter a Database-LockFailure-LockHeldByAnother error when using optimistic locking in Pega Platform. This error is specific to pessimistic locking. In the case of optimistic locking, Pega uses its conflict detection and resolution mechanism to handle conflicts.
This is a GenAI-powered tool. All generated answers require validation against the provided references.
@MarijeSchillern@Ramkumar Kalidoss
Thank you for the reply.
On my understanding , Sys-Lock record will not be created when we choose optimistic locking but db lock can be happened.
Since I posted this question a year ago I forgot about the details but I think that I handled this issue by adding error handling.