Concurrent Access to same Session wrt Lock Time-out - what is it?

  • Thread starter Thread starter Kevin Frey
  • Start date Start date
K

Kevin Frey

Hello,

I've been reading that ASP.NET serialises (ie. processes one at a time) HTTP
requests if two simultaneous requests need to access the same session state.
It also makes note that ASP.NET tries to reacquire a lock on the session
state every 1/2 second until the timeout is reached, and then it will
forcibly release the previous users lock and take the lock for itself.

What is this timeout figure?

One of our Session state values is a live object that represents a
connection to an application server (in the future we'll dispense with this
and instantiate-on-demand using a "lightweight" connection, but we can't
right now), and it looks very much like two requests are hitting our
"connection" object simultaneously, resulting in dodgy behaviour, exceptions
etc.

Since ASP.NET is meant to protect us from having to manage this ourself, I'm
wondering what the timeout is (at which point you lose the protection of
ASP.NET).

Even a ballpark figure would be appreciated - seconds, minutes, hours?

Thanks

Kevin
 
Kevin,
Session is per user can you rephrase your question to take this into account?

Thanks
DWS
 
I've found the cause of my problem (unrelated), but for interests sake, I'll
ask the question anyway:

Scenario:

User 1 commences a session with the web server (producing SessionId 1).

They then use "File->New Window" to open a second window. Both windows are
now associated with SessionId = 1.

In the first window the user issues a request for a .aspx page. Assuming the
first page takes several seconds to process; the user immediately then
issues another request in the second window.

At this point the web server is now seeing two requests for the SAME
SessionId. ASP.NET serialises (sequences) the requests so that only one
request runs at a time, because otherwise running both requests
simultaneously might corrupt Session data (depending on what the ASP.NET
page code does).

ASP.NET only waits a certain amount of time for the first request to finish,
before it "takes over" the session lock.

I want to know how long that time is, before ASP.NET will forcibly take over
the lock. The nett result is that on a long-running (?) page, ASP.NET might
in fact allow another request to start before the first one has finished.

I think my original question implied this - because two requests needing to
access the SAME session state implies the same Session Id. But I'm still
interested in the answer.

Thanks

Kevin
 
Back
Top