Case locking in pega

What is the case locking mechanism in pega?

Pega case locking prevents conflicts when a user attempts to submit cases that are already updated, this is the "Default locking" strategy in pega. Allowing only one user to open the case and work while the second user tries to open the same case pega displays a locking message saying that the case is being locked by the first user. However, the second user still can open the case in read-only mode. When the first user opens the case, the case acquires the lock and by default, pega locks the case for 30 mins or until the user closes the case or submits the case whichever comes first.

locking cases in Pega

In this situation, if we want to allow more than one user to open the case and work on the "Allow multiple users"(Optimistic locking) option provides access to both the users. A lock occurs only when the user submits the case. When two users are working on the case, whoever submits first those changes will save into the system when other user tries to submit the changes pega displays a message with the first user name and time. The second user has to refresh the case to reflect the first user changes and submit his changes.

Pega Case locking:

When you configure locking strategy on top-level parent case, if there are any child cases under it all the child cases adhere to the lock setting from the parent case. If the parent case has an "Allow one user" locking setting and all child cases will have the same setting at runtime. 

For example Service Request is the parent case and it has child cases "Parking" and "Roads".Both use the Allow one user a locking option. When a user opens a Parking case, the case and the parent Service Request case are locked, you can override the locking setting at the child case level. This lets users make concurrent updates to parent cases and their child cases without conflict.
If you set default locking mode (allow one user) at the parent level and all the child cases will have the same locking mode but you can change locking modes in child cases.

If you set optimistic locking mode (Allow multiple users) mode on the parent case then all the child cases will have the same optimistic locking mode and you can not change/override the settings at child case levels.

The recommended approach is to lock the parent when someone is working on a child's case in all possible scenarios.
Choosing a locking strategy depends on the business and requirements, if the case needs to be updated by multiple people we can go for optimistic locking knowing the risk of conflicts and need to accept and manage them.
How to configure case locking ?: Settings tab of Case type rule or case type rule (pyDefault) advanced tab in Locking section.

How to lock standalone cases: When a case is instantiated as a child case which is not actually a child case (standalone case) it doesn't inherit parent case locking options, we have to set the locking options on the case type rule advance tab of a child case.


Where can we see the locking information: class is System-Locks points a table pr_sys_locks in PegaDATA.

case locking will not be there on  Pega Temporary case


4 comments:

  1. very interesting topic on case locking.

    ReplyDelete
  2. can we hardly unlock a case which belongs to another requester session ?

    ReplyDelete
    Replies
    1. We can unlock a case with OOTB activities like "System-Locks.Releaselock", it will release the lock on work item. We need to pass InsHandle to this activity.

      Delete
  3. If we have two independent case types. How can we control locking so that only one user can work on a case at a time?

    ReplyDelete