How to set LOCK timeout for reading and writing in ASP.NET SessionState?

I have a WCF web service that uses ASP.NET session state. WCF sets a read and write lock for the session for each request. This means that my web service can only process one request at a time for each user, which degrades the perceived performance of our AJAX application.

So, I'm trying to find a way around this limitation.

  • Using read-only locks (which allows concurrent session access) is not supported by WCF.
  • I did not find a way to release the read and write lock manually during request processing
  • So, now I think there might be some way to set the read and write lock timeout for a very short period of time so that the wait wait does not require a very long wait. See the lower part in bold.

From MSDN: http://msdn.microsoft.com/en-us/library/ms178581.aspx

"If two simultaneous requests are made for one session, the first request gets exclusive access to the session information. The second request is only executed after the first request is completed. (The second session can also be accessed if the exclusive blocking of information is released because the first request exceeds the time- lockout.) If the EnableSessionState value in the @ Pages directive is set to ReadOnly, a request for read-only session information does not result in an exclusive lock on the session data. "

... But I did not find any information about how long this lock timeout took, or how to change it.

+3
source share
2 answers

Has anyone tried to use SQLSessionStateProvider and modify the SP? I did this in dev and seems to have circumvented blocking issues, but not sure if it has any side effects. Basically what I did was change 3 SPs that receive exclusive locks, so the Lock column is always 0.

0
source

I can tell you that the httpRuntime runtime controls this blocking time, however, the documentation for this field indicates that the thread should be terminated at this point. I know from experience that this thread does not stop and ultimately returns data, but a new thread is generated to process requests in the queue.

By default, this value is 110 seconds after 2.0 asp, and before that, 90 seconds. I am worried about a change in this behavior in the future and a “fix”.

+1
source

All Articles