hi can anyone help me to find how to effectively share database connection objects from .net connection pool. Mine is a web appplication and i have to limit the connection pool size to a particlar number too(say 20 connections) .so that requests from all client browser share this 20 connections.
And i have read that if more than 20 request comes at same time the rest of the requests are forced to wait till any conection in pool is freed. can i have a better way of managing this connections?
My main aim is to process as many requests in webserver without giving much overload on database server. can anyone help me please..
hi can anyone help me to find how to effectively share database connection objects
Share
Connections will be automatically pulled from the pool based on the connection string, so if you don’t vary your connection string for each user (or other purpose), you will be able to reuse a connection from the pool as soon as you are done with one (note that I am describing the behavior implemented by the pooling code and not anything that you have to do or worry about).
In order to be successful with this, you need to ensure that your connections are only open exactly as long as you need them to be and that they are always, always closed (this is general advice, not just specific to your situation).
If you find that you are running into the connection pool limit, you can trap this error and either tell the user to try again later or spin for a brief period and try the connection again.