Session and concurrent request
Hi
We all have worked with Asp.Net session objects in some point of time. An interesting question came in between the discussion with my colleagues on concurrent request and session state. Here is what I have to share with all on session and concurrent users.
In asp.net session state is exclusive for each request and session. This means that if two different users access the session there session will be concurrent. Not only that even if two concurrent requests are mode from same session (with same session ID) the first session will have exclusive rights to the session information. The second request will not be executed till the first request is complete. The second request execution will only start after the first request execution is finished or the exclusive lock on the session has freed (due to timeout) in the first session.
Remember if the session state for the page is read-only then the request will not have exclusive lock on the session data. However, read-only requests for session data might still have to wait for a lock set by a read-write request for session data to clear.
Vikram
P.S. You can check my previous Blogs on session here and here