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




Answers were Sorted based on User's Feedback



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

Answer / kiran

1. InProcSessionStateStore-> which stores session state in memory in the ASP.NET worker process (current server)
2. OutOfProcSessionStateStore-> which stores session state in memory in an external state server process
3. SqlSessionStateStore-> which stores session state in Microsoft SQL Server and Microsoft SQL Server Express databases

Is This Answer Correct ?    0 Yes 0 No

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

Answer / 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




More ASP.NET Interview Questions

What data types do the RangeValidator control support?

2 Answers   Siebel Systems,


How to use one project files into another project?

4 Answers   HP,


Give an example appropriate use forweb service as opposed to a non-serviced .NET component

1 Answers   Siebel,


How to authenticate users using Web.Config ?

1 Answers   Accenture,


Explain the concept of MVC Scaffolding?

0 Answers   B-Ways TecnoSoft,






Describe the application event handlers in ASP.NET?

0 Answers   HCL,


What is the importence of the INTERFACE? but not the inheritence concept?and why we r declaring the empty methods in that? we can directly implements with in the class know? Tell me the importence?

2 Answers  


To make Cache item dependent on a file,directory or other cached item ,you should create an instance of which clause?

1 Answers  


How to do state management in ASP.NET?

0 Answers   BirlaSoft,


Can private assembly be used for more than one application? If so how?

7 Answers   Satyam,


Explain the advantages of passport authentication.

0 Answers  


i have 3+ exp in .net? i am going interview now but they asked me do you know any TOOL? which tool will i study please refer me?

0 Answers   Wipro,






Categories