Dot Net - Connection Pooling

The connection string representing an open and uniquepooling.
link to a data source. Where a distributed system isIf we take database connections continuously open
held, this involves a network connection. Thiscan be troublesome, it can be help full for applications
connection Depends on the data source, thethat are in constant communication with a database by
programming interface of the various connectionnegating the need to re-open connections. Some
objects may be different depends upon which theydatabase administrators may frown on the practice
are build on. A connection object is specific to asince multiple connections to the database are open.
particular type of data source, such as it is different forUsing connection pooling depends upon available
SQL Server and Oracle and Microsoft Access.server resources and application requirements (i.e.,
Connection objects are not used interchangeablydoes it really need it).
across different data sources, but all the methods andUsing connection pooling - Dot Net Interview Questions
properties grouped in the IDb Connection interface.Connection pooling is enabled by default. You may
In ADO NET, connection objects are implementedoverride the default behavior with the pooling setting in
within data providers as sealed classes. So athe connection string. The following SQL Server
connection class can never be modified or overridden,connection string does not utilize connection pooling:
it is just configured through properties and attributes.Data Source=TestServer;Initial Catalog=Northwind;
We can say that in Ado net all the connection classesUser ID=Chester;Password=Tester;Pooling=False;
support connection pooling, although each class may• Max Pool Size: The maximum number of
implement in different manner. Connection pooling isconnections allowed in the pool. The default value is
implicit, so no need to do manually because it provider100.
manages this automatically.• Min Pool Size: The minimum number of
ADO NET pools connections with the sameconnections allowed in the pool. The default value is
connection or configuration. We can maintain morezero.
than one pool, one for each configuration. An• Enlist: Signals whether the Pooler
interesting note: Connection pooling is utilized by defaultautomatically enlists the connection in the creation
otherwise specified. If we close and dispose of allthread's current transaction context. The default value
connections, then there will be no pool left in connectionis true.