Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Is it necessary to lock application state before accessing it ?



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

Post New Answer

More ASP.NET Interview Questions

which event in global.asx that fires for every request of same user?

4 Answers   FactorH,


What r new things introduced in ASP.NET 2.0 in comparision to ASP.NET 1.1

1 Answers  


Which namespace do the classes, allowing you to support COM functionality, are located?

1 Answers  


How we can bind textbox,listbox and datagrid to sql server database in asp.net using visualstudio.net language (vb.net)?

2 Answers   rocsearch,


Explain what is postback in asp. Net?

0 Answers  


What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?

2 Answers  


What is server components?

0 Answers  


Where sessions are stored?

0 Answers  


which is faster ArraytList Or Collection ? how? hows the Hashing works internally ?

2 Answers   Emphasis,


What is the maximum number of classes that can be contained in one dll file?

0 Answers  


What does the "EnableViewState" property do? Why would I want it on or off?

2 Answers   Photon Infotech, Siebel Systems, Syntax Softtech,


What is postback and autopostback in asp.net?

0 Answers  


Categories