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