What are the two types of locking in Pega in PRPC?

Types of locking in Pega

In Pega PRPC (Pega Rules Process Commander), the two primary types of locking in pega mechanisms used to manage concurrent access to cases and work items are.

There are two types of locking in Pega.

1. Default: Lock will be acquired when the case is opened.

2. Optimistic: Lock will be acquired only when action is taken on the case.

The type of locking can be chosen under the setting tab for case type. By default, Locking Multiple Operators cannot open the case simultaneously.

In optimistic locking, a case can be opened in parallel by multiple operators. They cannot submit at the same time.

Types of locking in Pega
Types of locking in Pega

1. Default (Pessimistic) Locking:

  • Description: In default or pessimistic locking, a lock on the case or work item is acquired as soon as a user opens it for processing. This lock prevents other users from modifying the same case until the lock is released, ensuring that only one user can make changes at a time.
  • Use Case: This type of locking is ideal in scenarios where it is essential to maintain data integrity and consistency, especially when there is a high likelihood of conflicts arising from concurrent updates by multiple users.
  • Conflict Resolution: Since the case is locked as soon as it is opened, other users attempting to access the same case will receive a notification that the case is locked and cannot be modified until the lock is released. This approach simplifies conflict resolution as it inherently prevents concurrent modifications.

Key Features:

  • Immediate Lock Acquisition: As soon as a user opens a case, the system acquires a lock, preventing others from making changes.
  • Lock Duration: The lock remains in place until the user completes their task and submits the changes, or the lock times out.
  • Lock Management: Administrators can configure lock timeout settings to avoid locks being held indefinitely in case of user inactivity or system issues.

2.Optimistic Locking:

  • Description: In optimistic locking, a lock on the case or work item is not acquired when a user opens it. Instead, the lock is applied only when the user attempts to save changes to the case. This allows multiple users to open and view the same case simultaneously.
  • Use Case: This type of locking is beneficial in environments where conflicts are infrequent, as it enhances system performance by reducing the duration for which locks are held. It is suitable for scenarios where users are mostly reading data rather than updating it.
  • Conflict Resolution: If two users try to save changes to the same case at the same time, the system will detect the conflict. The second user attempting to save will be notified that the case has been updated by another user, and they will need to reload the case and reapply their changes if necessary.

Key Features:

  • Deferred Lock Acquisition: Users can view and potentially edit cases without immediate locks, only locking at the point of data modification.
  • Conflict Detection: The system checks for conflicts when changes are saved. If the data has been modified by another user, a conflict resolution process is triggered.
  • Version Control: This often involves maintaining version numbers or timestamps to detect changes made by other users.
Work Object types of locking in Pega Locking Functional Algorithm:
  • When an operator tries to edit a case, PRPC verifies whether any other operator is currently editing the same case or not.
  • If yes, it displays a message saying that some other operator is editing it.
  • If no, it allows the current operator to edit the case.
Work Object Locking Technical:
  1. When an operator Try to edit a case; PRPC verifies if there is a record in the table “PR_SYS_LOCKS.”.
  2. This option conveys the core message: finding the record and its locked state due to another user’s edit.
  3. “If no record exists, PRPC adds a record in PR_SYS_LOCKS, granting the lock to the current user.”

Acquiring a lock means inserting a record into the PR_SYS_LOCKS table.

Releasing lock means deleting the record from the PR_SYS_LOCKS table.

When an operator opens a work object, PRPC acquires a lock-on case. At the same time, when others try to open the case, it displays the message’. The c case is being modified, Oepretor1′. This is called default locking.


Both types of locking in pega serve different purposes and are chosen. Based on the specific needs of the application and the nature of user interactions with cases and work items.

More topicsĀ  on technology click here




Leave a Comment