Is it necessary to lock application state before accessing it ?
Answer / kumar saurabh
Only if you're performing a multistep update and want the update to be treated as an atomic operation. Here's an example:
Application.Lock ();
Application["ItemsSold"] = (int) Application["ItemsSold"] + 1;
Application["ItemsLeft"] = (int) Application["ItemsLeft"] - 1;
Application.UnLock ();
By locking application state before updating it and unlocking it afterwards, you ensure that another request being processed on another thread doesn't read application state at exactly the wrong time and see an inconsistent view of it.
Is This Answer Correct ? | 0 Yes | 0 No |
How do you perform validations?
In what languages in ASP written?
.net allows which inheritence
6 Answers AG Technologies, Samcomm,
What does this do? gacutil /l | find /i about
what is asp.net
Explain the flow of processing of the request? : asp.net mvc
how to create bin folder in asp.net2.0
Define ViewState and how can it be used?
what is new debug tools in asp.net ?
What is role manager work in web.config? how to restrict perticular pages from the users using the role manager?
Please brief not about xsd,xslt & xml?
How many types of sessions are there in asp net?