Hi all,
Lets imagine that there's a process that locks an entry of a gived domain, in my example the ID 2 of the table User.tApplications and using an exclusive lock. Additionally the error handling is managed by a $ETrap routine wich will look for error data in order to log it
Set $ETrap = "Do Err1^ErrRoutine"
Set obj = ##class(User.tApplications).%OpenId(2,"4",.errors)
If ($System.Status.IsError(errors){// Error: ERR_PESSIMISTIC_LOCK Set $ECode = <MyerrorCode>}When a second process try to do the same action will cause an error informing that there's a lock (that is ok)