|
-
Sep 27th, 2007, 08:00 AM
#1
Thread Starter
Hyperactive Member
[2005] ...All pooled connections were in use andmax pool size was reached....
Hello,
I am getting the following error in an application I am looking after (The writer of the app has left so they are pretty stuck)
=====================
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.
======================
From reading on the web it looks at though this has been caused by connections being left open, which is fine, I can look to close these at a later point.
However, I'm really after a quick fix as I can't take the system off-line at the moment.
Can anyone help please ?
-
Sep 27th, 2007, 08:21 AM
#2
Re: [2005] ...All pooled connections were in use andmax pool size was reached....
Pooled connetions to what? Is it a DB? What type?
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Sep 27th, 2007, 08:32 AM
#3
Thread Starter
Hyperactive Member
Re: [2005] ...All pooled connections were in use andmax pool size was reached....
Sorry, it's to a SQL Server DB if this helps.
-
Sep 27th, 2007, 08:41 AM
#4
Re: [2005] ...All pooled connections were in use andmax pool size was reached....
You're using a SqlConnection and it's not working, so the natural first step would be to read the MSDN help topic for that class. It has this to say:
To deploy high-performance applications, you must use connection pooling. When you use the .NET Framework Data Provider for SQL Server, you do not have to enable connection pooling because the provider manages this automatically, although you can modify some settings. For more information, see Connection Pooling for the .NET Framework Data Provider for SQL Server.
Does that sound like it might be relevant? If you ignore the help documentation then are you really doing all you can do to fix an issue?
-
Sep 27th, 2007, 09:00 AM
#5
Re: [2005] ...All pooled connections were in use andmax pool size was reached....
Bottom line.... you're opening connections and not closing them.... re-evaluate all of the connections you are making and make sure that you are EXPLICITLY closing them when done.
-tg
-
Sep 27th, 2007, 09:06 AM
#6
Re: [2005] ...All pooled connections were in use andmax pool size was reached....
The documentation I mentioned says that the default maximum number of pooled connections is 100, so if you've failed to close 100 database connections then your software is essentially junk. Given that the cause of the issue is well-known you should absolutely follow techgnome's advice. How hard can it be to find all the places a connection is opened and simply call its Close method?
-
Sep 27th, 2007, 09:21 AM
#7
Thread Starter
Hyperactive Member
Re: [2005] ...All pooled connections were in use andmax pool size was reached....
Well I know for a fact that there are nowhere near 100 connections being opened, but I'll look at those that are and close them.
Thanks.
-
Sep 27th, 2007, 10:03 AM
#8
Re: [2005] ...All pooled connections were in use andmax pool size was reached....
It's easy to say that.... but I also know for a fact that it is possible to do it unknowingly.... as I found out last week.... I got snagged for some connections I was using in a loop.... because of the high rate at which I was flipping through the loop, I ate up all the connections in about 30 seconds..... took some re-architecturing, but it's all good now.
-tg
-
Sep 27th, 2007, 06:13 PM
#9
Re: [2005] ...All pooled connections were in use andmax pool size was reached....
A connection pool is created for each unique connection string. When a pool is created, multiple connection objects are created and added to the pool so that the minimum pool size requirement is satisfied. Connections are added to the pool as needed, up to the maximum pool size specified (100 is the default). Connections are released back into the pool when they are closed or disposed.
You can specify a MinPoolSize and MaxPoolSize value in your connection string if you don't want to use the defaults of 0 and 100.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|