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 ?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

14. What are your Future Plans for Swatz Oils GROUP U.K?

2203


Explain the steps to be followed to use passport authentication.

1047


Can you explain architecture of your project ?

1133


Any one can tell how we store tiff format images in database and retrive from the database(need for tiff format only)

2032


To load your generated dataset with data which method do you invoke?

1120


What are all the various Estimation Techniques available ?

1105


What are client activated objects?

1024


What is a page life cycle?

1051


What is the difference between asp.net and mvc?

1120


What is cached data phone?

1043


List of words of preprocessor in .net?

945


Which dll handles the request of .aspx page?

968


What are the event handlers that we can have in global.asax file?

973


What is .net framework and what are the main components of it?

846


To display data in a Repeater control which template you provide?

1043