What is connection pooling and what is the maximum Pool Size in ADO.NET Connection String?- A connection pool is created when a connection is opened the first time. The next time a connection is opened, the connection string is matched and if found exactly equal, the connection pooling would work.
- Otherwise, a new connection is opened, and connection pooling won't be used.
- Maximum pool size is the maximum number of connection objects to be pooled.
- If the maximum pool size is reached, then the requests are queued until some connections are released back to the pool. It is therefore advisable to close the connection once done with it. What is connection pooling and what is the maximum Pool Size in ADO.NET Connection String?Connection pooling is a method of reusing the active database connections instead of creating new ones every time the user request one. Connection pool manager keeps track of all the open connections. When a new request comes in, the pool manager checks if there exists any unused connections and returns one if available. If all connections are busy and the maximum pool size has not been reached, a new connection is formed and added to the pool. And if the max pool size is reached, then the requests gets queued up until a connection in the pool becomes available or the connection attempt times out.
Connection pooling behavior is controlled by the connection string parameters. The following are four parameters that control most of the connection pooling behavior:
Default max pool size is 100.
|