Google News
logo
Pega - Interview Questions
What do you mean by Locking in the context of Pega? What are the different types of locking? Explain them.
When two or more actions try to update a case at the same time, the most recent action may overwrite data written by the prior action. Overwrites can cause data corruption or loss, causing delays in case processing and possibly resulting in an inaccurate case resolution. If an application supports several users at the same time, a case locking strategy is critical for data integrity.
 
In Locking, we configure an appropriate locking technique for each case type to avoid data corruption or loss due to overwrites. Pessimistic locking and optimistic locking are two solutions that Pega Platform enables to balance the need for user access with the necessity for data security.
 
Pessimistic Locking :  When an application uses a pessimistic locking approach to open an object, it uses an exclusive lock. When a person or a system opens an object, they have exclusive access to it until the application unlocks it. Other users are unable to edit the item while it is locked.
 
For example, an underwriter examines an open life insurance claim to determine the amount of benefit that a claimant is entitled to. As the underwriter collects evidence and updates the case, a complex claim may necessitate extensive computations and referrals to third parties, and any additional modifications may override claim values and generate an inaccurate payout to the claimant. Apply a pessimistic locking approach in this situation to prevent other users from overwriting data when the underwriter updates the claim and changes the payout amount.
 
Optimistic Locking :  When an application uses an optimistic locking approach, it does not use an exclusive lock when opening an object. Instead, the item can be opened and edited at any moment by any user or the system itself. Before making any modifications to the item, the program checks to see if it has changed.
 
A manager, for example, may need to evaluate the most recent data for a given service request instance. A case worker may need to update the case at the same time as the manager does not need to update any information. Apply an optimistic locking approach in this situation to prevent the manager from locking the case and preventing a case worker from completing an assignment that would push the case toward resolution.
Advertisement