. NET database connection pool compounding (default)

Source: Internet
Author: User
Tags connection pooling connection reset

Ado.net has the connection function, all. NET open method basically does not have to consider the connection problem, no wonder. NET connection pool data can not be found on the network.. NET connection pooling is available in the connection string only:

Controlling connection Pool with connection string keywords

The ConnectionString property is an attribute of the SqlConnection object that supports a connection string/value pair that is used to adjust the connection pool behavior. The following table is the value and explanation of the ConnectionString.

Name
Default value
Describe

Connection Lifetime
0
When a connection returns to pool, its time and creation time are released if it is longer than the connection Lifetime. This is useful for new server balances that are added to the cluster. A value of 0 guarantees that the connection has a maximum time limit.

Connection Reset
' True '
Determines whether the database connection is reset when it is removed from the pool.

Enlist
' True '
True Pooler automatically lists the action context of the currently created thread, if the operation contexts exist.

Max Pool Size
100
Maximum number of connections allowed in pool.

Min Pool Size
0
The minimum number of connections allowed in the pool.

Pooling
' True '
True, the connection is removed from the pool and, if necessary, created or added to the appropriate pool.

Performance registers for Connection pool

SQL Server. NET Data provider has added a number of performance registers to enable users to adjust the connection pool feature. Here are a few registers:

Counting device
Describe

SqlClient: Number of buffered and non-buffered connections
Current number of connections

SqlClient: Current number of buffered connections
All connections in the pool that are associated with the current process

SqlClient: Current Connection pool number
The number of pools connected to the current process

SqlClient: Maximum number of buffer connections
The maximum number of connections that have been used since the start of the process. This register makes sense only if it is associated with a particular process. _global instance Total returns 0

SqlClient: Total Failed connection number
Total Failures

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.