Reputation: 148704
from here
Im having trouble understanding
they say that ado.net does not include a connection pooling mechanism.
1) if im using a datareader
class which uses the connection string from the web.config
file - will it have / wont have a polling mechanism ?
2) if all of my sql connecting code is using the web.config connection string , will the connection pooling will be enabled ? or not ?
3) what is the default ?
Upvotes: 3
Views: 654
Reputation: 499262
The SQL Server and Oracle SQL providers implement connection pooling.
ADO.NET as a framework does not have the concept - there is no ConnectionPool
class, for example. If you look at the base classes of the database types, they do not have any connection pooling support - compare DbConnection
to SqlConnection
, for example.
To answer your questions:
If the provider has connection pooling implemented, it can using it. It depends on the provider you are using, not the connection string as such, though the connection pool settings are controlled through the connection string (if the provider has support for the options).
The SQL Server and the Oracle providers are the ones implementing pooling - they will read the connection string settings, but whether connection pooling is available or not depends on the provider (if the connection string disables pooling and it is available in the provider, the provider will disable it).
The default is to use connection pooling if available (this is provider dependent).
Upvotes: 8