不同用户的经典 ASP 同时调用
我有这个经典的 ASP Web 应用程序。每个用户都必须登录,并且他们最重要的数据保存在会话变量中。后端是MS-SQL。
当用户提交到特定页面时,该页面会执行很多操作,包括创建文件和访问数据库,因此每个请求最多可能需要 2-3 秒才能执行。
我的问题是:当用户提交到此页面时,在等待时,如果另一个用户提交到同一页面,则两个请求会同时执行,并且我的 VBScript 变量会混淆。换句话说,IIS(?)不会等待第一个请求完成才发送第二个请求。
我尝试使用 Application 对象实现某种池化,但失败得很惨。我需要能够一一威胁每个用户。第二个用户是否等待第一个用户并不重要。
在这种特殊情况下,我使用的是 IIS6,并且我的所有 asp 页面都分配给自定义应用程序池,该池的工作进程设置为 1(我不确定这是否会改变任何内容?
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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果将会话变量保存在 Session 对象中,一切都应该没问题。
另一方面,如果您将会话变量保存在 Application 对象中,则多个同时请求共享变量,并且如果没有同步,一切都会崩溃。
您在哪里存储会话变量?提供代码片段。
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.
然后日志将显示
The log would then show