Last post Apr 18, 2008 09:47 PM by Joco
Apr 18, 2008 08:15 PM|Joco|LINK
In C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 there are two scripts:
1- InstallPersistsqlState.sql (store ASP.NET session data in ASPState database)
2- InstallsqlState.sql (store in tempdb)
I am aware that the approach using tempdb requires to recreate the user permissions to tempdb..ASPStateTempApplications and tempdb..ASPStateTempSessions every time SQL Server (2000) is restarted. Other than that, is there any signficant differences? (Either
in performance, maintenance, scalability, etc.).
Also which approach is better for more recent .NET framework (2.0 and 3.5)?
Thanks in advance for any help.
Apr 18, 2008 08:46 PM|ely79|LINK
The big difference between the two, is that if you store session in tempdb, you will lose session state if sql server reboots. If you want to persist your session state, save it in aspstate. Besides that, there isn't any performance benefits you would
get from using one over another.
Apr 18, 2008 09:23 PM|Joco|LINK
Our SQL Server is rarely rebooted, and if it does, it is OK to lose session state for our application. For the ASPState, which approach is more popular?
Apr 18, 2008 09:29 PM|ely79|LINK
Two ways to look at it then, and you can decide which one is for you:
If you store in tempdb, the db will stay small and not get bloated because tempdb is dumped every time. However, in a reboot, you will lose state.
If you store in ASPState, you won't have to worry about losing state. I'm not for sure, but I imagine there is some type of process that purges expired sessions from the table, so this table probably won't become bloated as well.
Out of the two options, I would imagine that ASPState is the more popular choice. It is easier to setup and requires less security privileges.
Apr 18, 2008 09:47 PM|Joco|LINK
If the SQL Server doesn't reboot, tempdb will not be recreated and could bet big. Even if ASP.NET states are stored in tempdb you still need to run the SQL Job to purge the expired data (Job name = ASPState_Job_DeleteExpiredSessions) which runs every 1 to
5 minutes (ours is every 1 minute).
I was wondering about recommended practice in terms of maintenance, security or compatibility with recent .NET frameworks.