整个我的开发生涯我认为如果第一次启动请求很慢:他将对DB进行(同步)调用…等待回答…如果在此期间请求快速页面将完成,此请求将被处理系统正在等待DB的响应.
但今天我发现:
http://msdn.microsoft.com/en-us/library/system.web.httpapplication.aspx
One instance of the HttpApplication class is used to process many requests in its lifetime. However,it can process only one request at a time. Thus,member variables can be used to store per-request data.
这是否意味着我原来的想法是错的?
你能澄清一下他们的意思吗?我很确定这件事是我所期待的……
解决方法
您可以在这里找到更多信息:
http://msdn.microsoft.com/en-us/library/ie/ms178581.aspx
Concurrent Requests and Session State
Access to ASP.NET session state is exclusive per session,which means that if two different users make concurrent requests,access to each separate session is granted concurrently. However,if two concurrent requests are made for the same session (by using the same SessionID value),the first request gets exclusive access to the session information. The second request executes only after the first request is finished. (The second session can also get access if the exclusive lock on the information is freed because the first request exceeds the lock time-out.) If the EnableSessionState value in the @ Page directive is set to ReadOnly,a request for the read-only session information does not result in an 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.