I am working on an application that has a parent work object, with a tree of many child work objects. It is set up so that the parent is not locked when the children are opened - so that different users can work on different children in parallel. At the end of processing some of the children, an activity runs that opens and updates the parent very briefly.
If the parent is already opened by another user, Obj-Open-By-Handle reports a locking error, which we catch and create a page-error (so the user can re-try after the other user is finished). This works well and the users are happy with the results.
But we have problems when the parent object is open in another Tab of the same browser. In this case Obj-Open-By-Handle in the child thread does not report an error, so we go ahead and update the parent object, and save it. The flow commits the change & the lock is lost when we return to the tab with the parent object.
Is there any way to detect this condition in advance?
While calling Obj-Open-By-Handle you can also pass LockInfoPage param and check the value on that page for which requestor and user actually holds the lock. If it is the same then you can apply some logic.
When we open the second PRPC tab, we want to know if the parent object is locked (by us) but PRPC doesn't tell us. It lets us re-lock it without telling us that we already have a lock on it & then when we commit the object the lock is closed. When we return to the first tab, we no longer have a lock. How can we get PRPC to stop letting us move the lock to the second tab? If we already have an object locked in one tab, we don't want to be able to open it in another tab at the same time.