How does ASP.Net connect to SQL Server express
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.
Does each user connect using the same login to SQL Express (think its NETWORK-SERVICE)?
By default, yes. The application pool's identity is used, unless you activate impersonation.
If 2 people hit the same web page at the same time how many connections are opened to SQL Express?
It depends on your connection pool settings
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?
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.
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.
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)
精彩评论