Discussion:
StateServer
Kris Shanmugam
2008-04-22 02:03:22 UTC
Permalink
We've been storing some audit data / site usage data by using the
Session_End event to persist some session data in a database. We cannot do
this when using a StateServer (out-of-proc) as this event is not
available. Any ideas on possible solutions when using a StateServer?

Thanks,
Kris

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Shawn Wildermuth
2008-04-22 03:49:46 UTC
Permalink
It probably won't work with StateServer (or SQL Server)...there are some 3rd
party solutions, but I am not familiar enough to know whether SessionEnd is
called...any chance not using SessionEnd is a better solution?

Thanks,

Shawn Wildermuth
http://adoguy.com
http://wildermuthconsulting.com
http://geekdinners.com
Microsoft MVP (C#), MCSD.NET, Author and Speaker

The Silverlight Tour is coming to a city near you!


-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Kris Shanmugam
Sent: Monday, April 21, 2008 10:03 PM
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: [DOTNET-WEB] StateServer

We've been storing some audit data / site usage data by using the
Session_End event to persist some session data in a database. We cannot do
this when using a StateServer (out-of-proc) as this event is not
available. Any ideas on possible solutions when using a StateServer?

Thanks,
Kris

===================================
This list is hosted by DevelopMentorR http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Marc Brooks
2008-04-22 18:58:41 UTC
Permalink
Doing this at session end is way too late... you should save state at
every Page end. If you have things that you want done after a session
is abandoned, you should record those actions for deferred execution
and then have a background thread that does the deed when the session
goes stale. This can all be done without any real work using an "undo
action" table that records the stuff to be executed and a
QueueWorkItem call to insert the deferred action.

Marc
Post by Kris Shanmugam
We've been storing some audit data / site usage data by using the
Session_End event to persist some session data in a database. We cannot do
this when using a StateServer (out-of-proc) as this event is not
available. Any ideas on possible solutions when using a StateServer?
Thanks,
Kris
===================================
This list is hosted by DevelopMentor(R) http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
--
"Your lack of planning DOES constitute an emergency on my part... so
PLAN BETTER! "

Marc C. Brooks
http://musingmarc.blogspot.com

===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Kris Shanmugam
2008-04-23 04:47:49 UTC
Permalink
I've seen some samples that log this information to a database during a base page's init or pre_init event and some articles discussing the use of HTTP Modules and using application events and thread pools to achieve this functionality. There were suggestions about using a sliding cache to determine when a session becomes stale, using log4net or something similar to write out a file periodically etc. The solution, however, doesn't seem to be clear to me. Would it be possible provide a link or a small sample that makes use of a QueueWorkItemCall?

Thanks much,Kris
_________________________________________________________________
Spell a grand slam in this game where word skill meets World Series. Get in the game.
http://club.live.com/word_slugge

Continue reading on narkive:
Loading...