Follow in Twitter & Facebook

Like in Facebook

Powered By Blogger Widgets

Free Download

FREE Tools

Wednesday, February 15, 2012

What is Connection Pooling in Asp.Net ?

Here we will discuss what is connection pooling in and how it works.

- 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, If a pooled connection is available with the same configuration it returns it to the called insted 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.

You can also check Dataset and Datareader

0 on: "What is Connection Pooling in Asp.Net ?"