views:

27

answers:

1

Our asp.net 2.0 application has a very long process (synchronized) before sending response back to client. I observed that a second request, exactly same the initial one, was sent after client IE8 waited response for a long period of time while our application was still processing the first request.

I use page session with predefined key to store a flag when the initial request arrives and then starts long process while client IE waits for the response, so if second request comes in, our application checks the session value. After our application sets the session flag and starts processing, I use Fiddler “Abort Session” to abort the initial request, right away the second request (same as the first one) is sent automatically, but session value set earlier seems no longer exist.

Any thoughts?

A: 

When the second request comes in during your ongoing process isn't it overwritting your current request's value since it is only storing one item? Assuming both requests are coming in under the same session.

Maybe consider storing a list of items so that you can add the second item to your list of flags and then find any previous items and delete them.

Maybe kill the request currently in the session before starting the second requests session?

I don't really understand your problem / solution all that well but hopefully that helps.

Edit based on your comment:

If it no longer exists it's probably due to your session timing out and wiping the values so the second one wouldn't be able to access it. Is the second connection coming in under the exact same session? Compare the Session IDs in both cases. Also check your timeout.

You could also store this information in your application Cache that has a real long expiry. Have a dictionary with the key being the session ID or even the user if you only want one process per user and then store your value. This when the second request comes in by the same user, you will be able to find it regardless of session ID. Just make sure you are clearing once your process is complete.

Kelsey
Yes, it is one item, but it checks whether the flag has been stored in session first before sets the value. The problem is that the second request comes in, the flag set in session by the first one no longer exist.
@user150528 If this answer helped you, you should set an accepted answer which will improve you accept rate which in turn will lead to more people wanting to answer your future questions.
Kelsey