Results 1 to 9 of 9

Thread: [2005] ...All pooled connections were in use andmax pool size was reached....

  1. #1

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    [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 ?

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    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

  3. #3

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Re: [2005] ...All pooled connections were in use andmax pool size was reached....

    Sorry, it's to a SQL Server DB if this helps.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    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.

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width