Sunday, November 21, 2010

Connection Pooling

Creating and establishing a connection with a database server is a high resource consuming process and hence by result more time taking.
If any application needs to fire any query against any database server, we need to first establish a connection with the server and then execute the query against that database server.
So why we will again and again open and close the connection of Database, for that only connection pooling came in feature.
When the first time ADO.Net is stabilizing connection with the database and connection open with the respective credentials the ADO. Net  is  saving the references for the that connection and while closing the connection ADO.Net is not closing total connection and when another request done for the Database action ADO.Net using that references for the Database process so no Hassel for opening and closing connection again and again, and process is more faster .
Sample Connection String with Connection Pooling…..

initial catalog=Northwind; Data Source=localhost; Connection Timeout=30;
User Id=USER; Password=PASS; Min Pool Size=20; Max Pool Size=200;
 Incr Pool Size=10; Decr Pool Size=5;

2 comments: