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...

• What Session State providers are available in ASP.NET?
What are the pros and cons of each?

Answer Posted / munish

Three of the most important methods in a session state provider are GetItem, GetItemExclusive, and SetAndReleaseItemExclusive. The first two are called by SessionStateModule to retrieve a session from the data source. If the requested page implements the IRequiresSessionState interface (by default, all pages implement IRequiresSessionState), SessionStateModule's AcquireRequestState event handler calls the session state provider's GetItemExclusive method. The word "Exclusive" in the method name means that the session should be retrieved only if it's not currently being used by another request. If, on the other hand, the requested page implements the IReadOnlySessionState interface (the most common way to achieve this is to include an EnableSessionState="ReadOnly" attribute in the page's @ Page directive), SessionStateModule calls the provider's GetItem method. No exclusivity is required here, because overlapping read accesses are permitted by SessionStateModule.

In order to provide the exclusivity required by GetItemExclusive, a session state provider must implement a locking mechanism that prevents a given session from being accessed by two or more concurrent requests requiring read/write access to session state. That mechanism ensures the consistency of session state, by preventing concurrent requests from overwriting each other's changes. The locking mechanism must work even if the session state data source is a remote resource shared by several Web servers.

SessionStateModule reads sessions from the data source at the outset of each request, by calling GetItem or GetItemExclusive from its AcquireRequestState handler. At the end of the request, SessionStateModule's ReleaseRequestState handler calls the session state provider's SetAndReleaseItemExclusive method to commit changes to the data source, and release locks held by GetItemExclusive. A related method named ReleaseItemExclusive exists so that SessionStateModule can time out a locked session by commanding the session state provider to release the lock.

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a web server? What are the load limits in it?

1174


How can we apply themes to an asp.net application?

1084


How dataadapter.fill works?

1080


What is difference between or and orelse?

1046


Out of ASP or ASP.NET which one is stateless?

1302


What does asp in asp.net stand for?

1028


How do you secure your connection string information?

1040


When we use cookie less session? Explain its working?

1071


How to add DateTime Control in normal DataGrid Server Control?

1151


How is application management and maintenance improved in asp.net 2.0?

1038


Are there any resources for drop-in replacements for the default css that comes with the ASP.NET Website template?

1039


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

1964


Can you use Web API with ASP.NET Web Form?

1203


What is another word for redirect?

992


Explain About duration in caching technique

1118