Save, Delete or Commit has failed because lock "XXX" is not held
This is what I do when there is a problem with the Lock. Tipically, the error message is as follows:

This is what I do when there is a problem with the Lock. Tipically, the error message is as follows:
Use the following function:
@(Pega-RULES:DeclarePages).pzDeleteAllInstancesOfDeclarativePage(tools,D_MyDataPage)
That's all!