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