Support Article
Save, Delete or Commit has failed because lock is not held
SA-11926
Summary
You have implemented an Activity which calls a Obj-Open method on a class that allows locking. However, you have not selected the option to obtain a Lock while calling Obj-Save.
And the next step of the activity calls an Obj-Save on the same page.
When the activity is run the error message detailed below is displayed.
However, if you amend the activity so that this performs a Page-Copy in between the Obj-Open and Obj-Save. Then amend the Obj-Save so that it acts on the copied page instead of the original page. Then, when the run the activity is executed the save happens successfully, without displaying the message.
Error Messages
Save, Delete or Commit has failed because lock "XYZ ABC!GHJ " is not held
Steps to Reproduce
1. Build an activity which performs an Obj-Open or Obj-Open-By-Handle on a Work Object instance, but de-select the "Lock" option.
2. Add an Obj-Save activity to save the object
Root Cause
Product enhancement request item FDBK-11293 has been submitted, requesting improved lock checking when performing a Save operation on a page which was not explicitly created via a Obj-Open or Obj-Open-By-Handle method.
Resolution
If the underlying object allows for locking, and the intention of the activity is to update the information for that object, then the "Lock" should be selected.
Published February 19, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.