ASP.Net连接SQL Server是如何表达的
我的设置如下:
- 在同一台计算机上运行 IIS + SQL Server Express。
- SQL Server Express 具有命名管道 连接。
- IIS 托管 ASP.Net 网站 (v3.5)
- ASP.Net 站点有 Web 配置条目 使用集成的数据库 安全。
对此,ASP.Net应用程序之间的连接如何。和 SQL Server Express 处理吗?
每个用户是否使用相同的登录名连接到 SQL Express(认为其网络服务)?
如果 2 个人同时访问同一个网页,会打开多少个 SQL Express 连接?
是否取决于连接池中的设置?例如,如果连接池设置为 10,那么在本例中将打开 2 个连接?
或者是只使用一个连接,用户必须等待前一个用户的网页完成所有数据库操作才能处理他们的请求。
谢谢。
My set up is as follows
- IIS + SQL Server Express running on the same machine.
- SQL Server Express has named pipe
connections. - IIS hosts an ASP.Net website
(v3.5) - ASP.Net site has web config entry
to database using integrated
security.
In regard to this, how are the connections between the ASP.Net app. and SQL Server express handled?
Does each user connect using the same login to SQL Express (think its NETWORK-SERVICE)?
If 2 people hit the same web page at the same time how many connections are opened to SQL Express?
Is it up to the setting in connection pooling? E.g. if connection pooling is set to 10 then in this example 2 connections are opened?
Or is it that only one connection is used and users must wait for the previous user's webpage to finish all database operations before their request can be processed.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,是的。除非您激活模拟,否则将使用应用程序池的标识。
这取决于你的连接池设置
这是真的。不要忘记sql server有自己的并发和锁定机制。就我个人而言,我相信 Microsoft 的连接池默认值。我永远不需要改变它们。
大多数情况下,两个并发请求可以单独处理。仅当其中一个请求以高隔离级别向数据库打开事务时才会导致此类等待时间。 (但是,这不能防止冲突......您必须考虑冲突策略,例如逻辑锁定项目)
By default, yes. The application pool's identity is used, unless you activate impersonation.
It depends on your connection pool settings
That's true. Don't forget that sql server has its own concurency and locking mechanisms. Personally, I trust Microsoft with their defaults values for the connection pooling. I never have to change them.
In most case, two concurrent request can be handled separately. Only when one of the request opens a transaction to the DB with an high isolation level can cause such wait times. (However, this cannot prevent conflicts... you will have to take in consideration a conflict strategy, like logically locking an item)