What is Connection Pooling in Asp.Net ?

– Connecting to a database server typically consists of several time consuming steps.Most application use only one or a few different configurations for connections.

– This means that during application execution many identical connections will be repeated opened and closed.

– To minimize the cost of opening connections ADO.NET uses an optimization technique called Connection Pooling.

– Connection Pooling reduces the number of times that new connection must be opened.

– It manages connections by keeping alive a set of active connections for each given connection configuration.

– Whenever a user calls open on a connection (i.e con.open()), If a pooled connection is available with the same configuration it returns it to the called instead of creating a new connection.

– When the user or application call the close() (i.e con.close()), the connection is not going to close rather it returns back to the connection pool and ready to be used in the next open call.

– So Finally, Connection pools are container that contain open and reusable connections.

– By default, Connection pooling is enabled in ADO.NET. If you want to turn it off or disable it then specify Pooling = False in the connectionstring being used.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s