Posted: 23 Jan 2020 0:27 EST Last activity: 23 Jan 2020 2:42 EST
Locking Strategy for our business scenario
I have a business scenario where the user create child cases (implemented using pxaddchildwork from an activity) from the parent case and each parent case may have around 75 child cases.So 75 members should work on these cases simultaneously .
My understanding is if I use default locking the child case takes a lock on the parent case so if another user opens a different child case pega throws an error that we do not have a lock on parent case. So we are planning to use optimistic locking.
Is my understanding correct?
What are the disadvantages of using Default locking with do not lock parent on child case i know it does not update properties like covered count open .Has anyone faced any issue with this configuration as it is not recommended by pega?
Child case placing lock on parent case is not only for Default locking option.
The big difference between Default and Optimistic locking is that - in default locking the moment an operator opens any case, the lock will be held by that operator so other operator will not be able to make any change to the case until the first operators closes it. In optimistic locking, lock is not given to operator unless he makes change to case. once change is done and committed other users will see a message that case is modified by another user please refresh it. The optimistic locking is useful in cases when case is required to modified by many operators in random sequence. One example could be agent modifying the case in the background while same case is being worked by other web users.
We use optimistic locking in projects where cases where not having any child cases, and it worked well. For projects which has child case, there also we use optimistic locking as it gives flexibility of updating case by multiple user simultaneously. Initially we also relied on default locking fearing that some issues might come in Parent-Child Case association but later we had to change it to - Optimistic locking. this is my experience but a thorough test of all use case will give you more clarity on which mechanism is best suitable for your purpose.