Thank you both for your quick replies.
That was exactly what I was looking for....
I think I will be using both...one to stop the other processes accessing the global + locks to really ensure no other processes access the global.
My code will be something like the following:
// Stop other ensemble jobs accessing to the global to avoid bad messages. // Jobs are such as services/processes/operations by name. DO ##class(Ens.Director).EnableConfigItem("xxx",0,0)$$$LOGINFO("xxx Disabled")// Add a lock to control access to the global.// 0 => 1 attemp only.LOCK +^lockname:0// If lock is unsuccesfull, $TEST variable = 0If '$TEST {$$$LOGERROR("Lock cannot be obtained. Process cannot continue.")Quit tSC }$$$LOGINFO("LOCK on")*** code here to update global ***// Start other ensemble jobs accessing to the global to avoid bad messages. // Jobs are such as services/processes/operations by name. DO ##class(Ens.Director).EnableConfigItem("xxx",1,0)$$$LOGINFO("xxx Enabled")// REmove lock to control access to the global.LOCK -^lockname$$$LOGINFO("LOCK off")- Log in to post comments
