Reputation: 1266
Background
We have a large asp.net application and uses a lot of sessions like datasets, datatables etc. We want to support web farms for this application, so we want to save the session state in sql server. I am successfully storing all the required data into the sql sever and getting all the data fine as well. Our supported database is SQL Server 2005-Sql Server 2008. We have to store datatables and datasets in sessions, even we know it is going to be bit expensive.
My question is I want to understand the process used by ASP.Net to store the Session data in sql server. Any article etc. will help
Upvotes: 2
Views: 463
Reputation: 171421
I can think of two good resources for understanding SQL Server session state.
One is to understand what a session state provider must do by reading Implementing a Session-State Store Provider.
The other is to study the DDL used to create the session store. You will find a file named InstallSqlState.sql in the directory C:\Windows\Microsoft.NET\Framework\v4.0.30319 or similar on your machine.
You'll find DDL such as CREATE PROCEDURE dbo.DeleteExpiredSessions
which shows you exactly what is going on behind the scenes.
You can then test your knowledge by implementing your own custom provider that persists to XML or MySQL or Hadoop or Memcached or whatever you want.
Upvotes: 1