Вопрос

I encountered a bizarre issue that I hadn't previously and I thought I would inquire here to see if anyone had any recommendations.

Currently, my application has an area to create a new "recording" (which uses a Flash module within a new window to record audio) and when the recording is finish, the user submits the form and all of the audio data is posted to my controller.

This process can range in duration depending on the size of the audio, so the window will remain open until the uploading is finish and then it closes.

The problem occurs during the upload process, if the user uploads a recording and while it is uploading, attempts to open a new window (which is populated with the "Create Recording" view) and the loading of the new window contents stalls until the upload is complete.

The entire process works fine if I open up multiple windows for the Create Recording prior to actually uploading one of them, however if I start uploading one and then attempt to open a new window then it will "wait" on the upload operation to finish before populating the new window contents.

Это было полезно?

Решение

I think you're running into an issue with sessions.

Anything that is served while there is an active session and that can modify it (ie any .Net request, but not images/css/etc) will get an exclusive lock on the session object until the request completes. Other requests which can access the session will be queued until the lock is freed.

More information here

It's possible to work around by indicating that certain requests only need read-only access to the session-state. See the answers of the linked Q for full details.

There's an implementation of a custom session-state module here which may speed things up considerably. It works by caching the session info in a hash table in memory and then telling the framework that the session access has been completed.

Note that there are potential issues with this approach in that if 2 pages modify the session at approximately the same time, it may result in a race condition to see which modification gets preserved - so only do it if you fully understand the implications.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top