Sunday, February 12, 2012

all pooled connections were in use

I am getting an error like this

'Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.

This may have occurred because all pooled connections were in use and max pool size was reached.'

What shuld i do

:( :(

you can try setting a new max number of connections for the pool through the connection string.

here is an example connection string:conn.ConnectionString = "integrated security=SSPI;SERVER=YOUR_SERVER;DATABASE=YOUR_DB_NAME;Min Pool Size=5;Max Pool Size=60;Connect Timeout=2;";

see how max pool size is increased? also, here is a link to an article that may help->

http://www.15seconds.com/issue/040830.htm

hope this is helpful -- jp

|||

Try to optimize your query to work faster but if it will not help just change command timeout property to bigger number default is 30 s if I remember correctly. How long takes your query to execute in Management studio?

Thanks

|||

suji,

you'll notice in the connection string that i wrote before that there is also a connection timeout value. you could also try increasing that rather than increasing the pool size if you wish...--jp

|||

Where should I add this? is it in web.config ?

Now i have the following line related to connectionStrings in web config

<connectionStrings>
<add name="myConnectionString" connectionString="Data Source=mssql2005...............,48645\sqlexpress;Initial Catalog=sp;uid=spdmin; pwd=1234567;Trusted_Connection=no" providerName="System.Data.SqlClient"/>
</connectionStrings>

hope u can help me

|||

suji,

you can use the connection string in your web.config oreven your code is you wish. The connection string that i wrotebefore is simply the string itself. at minimum you need thatstring for the code that calls the timeout that you had before. --jp

No comments:

Post a Comment