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.
Unfortunately, activation email could not send to your email. Please try again.

Connection Pooling in .Net

Thread ID:

Created:

Updated:

Platform:

Replies:

57303 Mar 1,2007 02:01 AM Nov 24,2008 12:49 PM ASP.NET Web Forms (Classic) 1
loading
Tags: FAQ
Sachin Gaikwad
Asked On March 1, 2007 02:01 AM

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

Saurabh
Replied On November 24, 2008 12:49 PM


>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.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;