Use a group of name-value pairs to configure the link pool as a link string. For example, you can configure whether the pool is valid (which is valid by default). The maximum and minimum capacity of the pool is used for the time when the queued requests that open the link are blocked. The following example string configures the maximum and minimum capacity of the pool.
The following table describes the connectionstring values that can be used to adjust the connection pool behavior.
Name |
Default Value |
Description |
Connection lifetime |
0 |
When the connection is returned to the pool, the creation time of the connection is compared with the current time. If the time interval exceeds the value specified by connection lifetime (in seconds ), the connection is destroyed. In clustering configuration, you can use it to force load balancing between the running server and the online server. If the value is zero (0), the pool connection has the maximum timeout period. |
Enlist |
'True' |
If true, the pool manager automatically registers the connection in the current transaction context of the Creation thread. |
Max pool size |
100 |
Maximum number of connections allowed in the pool |
Min pool size |
0 |
The minimum number of connections maintained in the pool. |
Pooling |
'True' |
If the value is true, the connection is retrieved from the corresponding pool, or the connection is created and added to the corresponding pool when necessary. |
<Connectionstrings>
<Add name = "ccopconnstr" connectionstring = "Data Source = (local); pooling = true; Max pool size = 7500; min pool size = 5; packet size = 4096; initial catalog = CCOP; user id = sa; Password = wuaisheng; connection timeout = 150; "providername =" system. data. sqlclient "/>
</Connectionstrings>