Question
Do Lock controls need to be global?
We're having trouble with a datatable becoming corrupt. I believe it's caused by multiple asynchronous processes updating the table. I recently discovered the Lock component and believe this could solve the problem. However, the documentation doesn't specify if the lock should be a local or global variable. Does it matter if the lock is local or global?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
It should be global. Local scope items get disposed of when the automation thread ends, and thus any subsequent interaction with the control would be with a new copy which would defeat the purpose.
I am not 100% positive that this has been resolved or not, but at one point the timeout on the lock component's RequestLock method was in seconds instead of milliseconds. You might test that just to be sure and set the timeout accordingly.