Question
Zensar Technologies Ltd
IN
Last activity: 10 Jul 2023 10:46 EDT
This operation requires a lock on the object before it can proceed.
Hi, I am getting this error when I hit save button, on button action set I called one activity, The steps of activity are as follows:
Why this runtime error is coming?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Aaseya IT Services Pvt LTD
SA
In the activity loop, you doing obj open follow by Obj Delete and then multiple commit. Are both the commit performing a different action. A simple commit here would do the work for you. Not sure why you are using multiple commit.
Also, the Save you are doing outside the loop will have no use here. As your delete action will be committed inside the loop itself and you don't require the post save action outside the loop.
Please try the above changes and check if it works for you.
Zensar Technologies Ltd
IN
@PrakashDeep Ok, will change the code. Actually it is an existing code.
Zensar Technologies Ltd
IN
@AbhishekC1725 Hi, I changed the steps but still getting same error, According to my analysis Obj-Open method not able to gain lock. Note:- I checked Lock and release on commit option inside Obj-Open
Aaseya IT Services Pvt LTD
SA
Updated: 10 Jul 2023 7:55 EDT
Zensar Technologies Ltd
IN
@PrakashDeep For commiting changes in database, It is an activity Present in @baseclass {Created by previous team members} Description = This activity to be used only for the non-work instances (in the data or int classes)
Aaseya IT Services Pvt LTD
SA
Couldn't find this activity at my end. Please confirm one thing if there is any save operation in that activity? If so, it will create issues.
Updated: 10 Jul 2023 8:20 EDT
Zensar Technologies Ltd
IN
@PrakashDeep Hi, Sorry for that response, actually previous team member created CommitData Activity in @baseclass. And inside CommitData activity he called Commit. So that, we get warning in only one activity. FYI:- I am editing my previous comment. As of now we are doing Error Handling for solving this issue, Because we have multiple save operation in that functionalities. We used Page-Set-Messages Method, And inform user to please close the case and reopen it .
Aaseya IT Services Pvt LTD
SA
You can go with above approach if that works for you.
Another suggestion would be from my end, would be to just use basic commit method instead of calling activity for commit purpose. As there is actually no need of save if you are just trying to perform delete action on your instances.
Go with the approach whichever works for you
-
Abhishek Choubey