Application.Lock method

Obtains exclusive write access to the Application object.

Usage

Application.Lock
' ... modify application object ...
Application.Unlock

Tip

To avoid concurrency issues (such as a race condition), always lock the application before altering the Application.Contents collection (except in the Application_onStart event handler in global.asa file).

Warning

All other ASP blocks in the entire application will wait while the application is locked.