We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Connection Pooling in .Net

Hello Everyone...,
Can anyone explain me the concept of connection pooling ?
And also , how to use the connection pooling in ASP.Net??

1 Reply

SA Saurabh November 24, 2008 05:49 PM UTC


>Hello Everyone...,
Can anyone explain me the concept of connection pooling ?
And also , how to use the connection pooling in ASP.Net??


Its failry simple....

In a web scenario there exists a lot of operations that require data to be submitted and retrived from database.

If you have a application that does so often then opening and closing a connection everytime will defenetly consume some amount no matter how fast the server is.
This can be saved by connection pooling.
Connection pooling is nothing but a collection of open database connections, whenever a request for the connection comes its first checked against this connection pool, if an connection is availabe then it is returned.
Whenever you close a connection, the closed connection is returned to the connection pool.
This way you save the time require to create and dispose a connection.
By default connection pooling is enabled for sql connection object.
The connection pooling is managed using connection string.
following attribute from the connection string contribute to connction pooling setting.

1 . MinPoolSize = minimum number of connection to be opened.(This is the number of coonection that are opened when 1st request for the connection is made hence making the 1st open connection operation takes some time as compared to subsequent open operations)DEFAULT = 0;
2 . MaxPoolSize = Maximum number of connections that can be left open in a pool.
DEFAULT = 100
3 . Pooling = When true connection pooling is enabled. DEFAULT = true.
4 . Connection Life Time : The amount of time for which each connection will be kept in pool.

Be careful when you use Connection pooling as it uses FullText match algorithm, minute means change in connection string wll be responsible for creating new pool.


Loader.
Live Chat Icon For mobile
Up arrow icon