Dot Net - Connection Pooling
The connection string representing an open and unique link to a data source. Where a distributed system is held, this involves a network connection. This connection Depends on the data source, the programming interface of the various connection objects may be different depends upon which they are build on. A connection object is specific to a particular type of data source, such as it is different for SQL Server and Oracle and Microsoft Access. Connection objects are not used interchangeably across different data sources, but all the methods and properties grouped in the IDb Connection interface.
In ADO NET, connection objects are implemented within data providers as sealed classes. So a connection class can never be modified or overridden, it is just configured through properties and attributes. We can say that in Ado net all the connection classes support connection pooling, although each class may implement in different manner. Connection pooling is implicit, so no need to do manually because it provider manages this automatically.
ADO NET pools connections with the same connection or configuration. We can maintain more than one pool, one for each configuration. An interesting note: Connection pooling is utilized by default otherwise specified. If we close and dispose of all connections, then there will be no pool left in connection pooling.
If we take database connections continuously open can be troublesome, it can be help full for applications that are in constant communication with a database by negating the need to re-open connections. Some database administrators may frown on the practice since multiple connections to the database are open. Using connection pooling depends upon available server resources and application requirements (i.e., does it really need it).
Using connection pooling - Dot Net Interview Questions
Connection pooling is enabled by default. You may override the default behavior with the pooling setting in the connection string. The following SQL Server connection string does not utilize connection pooling:
Data Source=TestServer;Initial Catalog=Northwind;
User ID=Chester;Password=Tester;Pooling=False;