About Application.Lock ... What role does Application.UnLock have?

Source: Internet
Author: User

Because the application variable typically stores information that is shared by all users connected to the server (as in the program, "Global Variables"),
Because it is a global variable, it is easy to have two or more users at the same time to operate this variable to create a conflict, and Application.Lock and Application.UnLock is to solve the problem,
Using lock ensures that only one of the users connected to the server during a certain period of time can gain access to or modify the application variable (that is, locking the public variable). Any other user who wants to obtain such permission must wait for the current user to end their lock or the current ASP program terminates execution.

The current ASP program termination execution cannot be unlocked, only the site restarts, so the program must be guaranteed to unlock as soon as possible, especially in the middle of the execution of the statement may be wrong to pay more attention to
Application.Lock
EXECUTE statement
Application.UnLock

There was a strong man like this to pontificate! That's strong!!!

Application.Lock ... The role of Application.UnLock is like a "public toilet", each toilet door will have a lock, because the toilet is common, so that when you use, the toilet door to lock (Application.Lock), in order to use when you do not let others rushed in. When you're done, you'll have to open the lock (Application.UnLock) so that others can use it.

About Application.Lock ... What role does Application.UnLock have?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.