Steve
Steve

Reputation: 710

ASP Session State Overview

I work on a classic ASP web site that uses ASP session state to hold sate information. We use the sql database implementation of ASP session state.

We are having problems where sessions are being left locked and then subsequent requests to that session pile up into big queues that are affecting our performance. I don't expect you to be able to fix this for me but maybe someone could give me an overview of session state, as I don't think that i fully understand it.

What I don't understand is how we abandon a session or how we release locks on sessions that we have locked through a Get but dont update?

I have read the following to get this far in my understanding http://msdn.microsoft.com/en-gb/library/aa478952.aspx and http://msdn.microsoft.com/en-us/library/aa479041.aspx

As always any help will be gratefully received and appreciated.

Upvotes: 0

Views: 612

Answers (1)

Steve
Steve

Reputation: 710

I have spent some more time looking into this and i think that i have figured it out.

  • Abandoning a session is an explicit action, Session.Abandon()

  • Releasing a lock is an implicit action

On the page_load event a call to TempGetStateExclusive3 is made to get the session object. Exiting the page_load implicitly calls TempReleasStateItemExclusive. As a developer you are only in control of abandoning a session, the locking is handled for you by the framework.

This does not fix my issue with sessions being left locked. But at least now I know how sql server session state should work.

Thanks

Upvotes: 1

Related Questions