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

Explain what are the advantages of asp.net mvc framework? : asp.net mvc

0 Answers  


Apart from IDE what are the enhancements in asp.net 2.0?

0 Answers   Microsoft,


How can we prevent an aspx page get refreshed when any information fetch from the database ?

2 Answers   Minecode,


Can you create an app domain ?

1 Answers  


what is command line compiler.what are the steps and how it is related to debugging.

0 Answers  


How do you construct HtmlResponseMessage?

1 Answers  


What's a bubbled event?

3 Answers   Siebel,


About Garbage Collector?

3 Answers   Microsoft,


How To Authenticate Your Web service??

1 Answers  


what is DLL Hell and how it is solved in .NET? please explain clearly??

0 Answers   TCS,


what are the levels of securities need to be considered for the finincial web application?

1 Answers  


Features in ASP.NET ?

1 Answers   Microsoft,


Categories