在Classic asp中,我可以在Session对象中存储数据库连接吗? [英] In Classic asp, can I store a database connection in the Session object?

查看:152
本文介绍了在Classic asp中,我可以在Session对象中存储数据库连接吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在Session对象中存储数据库连接。

Can I store a database connection in the Session object?

推荐答案

http://support.microsoft.com/default.aspx/kb/243543

你不应该在Session中存储数据库连接。

You shouldnt store database connection in Session.

根据我的理解,如果你这样做,那么同一用户的后续ASP请求必须使用同一个线程。

From what I understand, if you do then subsequent ASP requests for the same user must use the same thread.

因此,如果你有一个繁忙的网站,可能你的线程已经被别人使用,所以你必须等待它可用。

Therefore if you have a busy site its likely that 'your' thread will already be being used by someone else, so you will have to wait for it to become available.

将更多用户与之相乘,您将获得每个人都等待所有人的线程和非常敏感的网站。

Multiply this up by lots more users and you will get everyone waiting for everyone elses thread and a not very responsive site.

这篇关于在Classic asp中,我可以在Session对象中存储数据库连接吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆