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 |
I have a component with 3 parameter and deployed to client side now i changed my dll method which takes 4 parameter.How can i deploy this without affecting the clent?s code ?
1 Answers Microsoft, Satyam, Wipro,
how can we create wcf in asp.net and how can we cll that in to asp.net application?plsss tel me each step clearly
What is the use of asp.net web api?
How to send data through querystring to another page but it should not be displayed in URL
Why would anyone need to implement their own hashtable or linked list?
What is the < machinekey > element and what two ASP.NET technologies is it used for ?
how can u create the blog in asp.net with C#?what is the data type u will use to store in sql server?
Explain a program using code nuggets to create a simple application? : asp.net mvc
What is the life-span of the items in the viewstate?
What are the event handlers that we can have in global.asax file?
Explain what is an abstract class?
What are session cookies?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)