Search code examples
asp-classicpooling

Classic ASP simultaneous calls from different users


I have this classic ASP web application. Each user must login and their most important data are kept in Session variables. Back-end is MS-SQL.

When user submit to a particular page, this ones does a lot of stuff including creating files and accessing the database, so each request can take up to 2-3 seconds to perform.

Here's my problem: When a user submit to this page, while he waits, if another user submit to the same page, both requests are then performed simultaneously and my VBScript variables gets mixed up. In other word, IIS (?) does not wait for the first request to be completed before sending the second one.

I tried implementing some kind of pooling using the Application object but it failed miserably. I need to be able to threat every user on a one-by-one basis. It does not matter if the second user waits for the first one.

In this particular case I'm using IIS6 and all my asp page are assigned to a custom Application Pool, worker process of this pool is set to 1 (I'm not sure if that changes anything ?


Solution

  • If you keep your session variables in a Session object, everything should be OK.

    If on the other hand you keep your session variables in an Application object, the multiple simultaneus requests share variables and without synchronization all hell breaks loose.

    Where do you store your session variables? Provide a code snippet.