Scope: managed applications, mobile applications, and ordinary applications.
Write constants outside transactions as this operation might become a bottleneck during the competitive work.
// Increase the number of posted documents displayed in the counter in constant
Procedure Posting(Cancel, PostingMode)
CurrentValue = Constants.PostedDocumentsCounter.Get();
Constants.PostedDocumentsCounter.Set(CurrentValue + 1);
While a value is written to the constant, other sessions that write the same constant are suspended. For more information about reasons for excessive locks and optimization methods, see the "Technological issues of large deployments" knowledge base.