how can we apply lock on objects
Can anyone please explain that how can we apply locks on objects and use them with examples.
Comments
the basic mechanic in ObjectScript is the LOCK command (https://docs.intersystems.com/iris20241/csp/docbook/Doc.View.cls?KEY=ITECHREF_lock)
for persistent objects this mechanic is named Concurrency
check this context with lots of various cases and examples
https://docs.intersystems.com/iris20241/csp/docbook/Doc.View.cls?KEY=GOBJ_concurrency
. https://docs.intersystems.com/iris20241/csp/docbook/DocBook.UI.Page.cls?KEY=GCOS_lockbasics
@Robert Cemper
Can we apply locks for class object?
YES, concurrency applies to persistent objects once the are sved the first time
this means: it doesn't apply when the object is NEW and has no ID yet.
Thanks for your reply
To lock a persistent object (in different modes) use the second argument of the %OpenId() method as described in Object Concurrency Options documentation.
Thanks.I will go through it.