6

I face the following problem :

Connection Pool has reached the maximum number of connections

I followed all the recommendations. the problem is n't like before but it happens rarely !!

I use the Using statement with all my connections and Readers .

Lately i face the following error , and i had to reset the iis to fix my problem.


Connection Pool has reached the maximum number of connections. at IBM.Data.Informix.IfxConnectionPool.ReportOpenTimeOut()
at IBM.Data.Informix.IfxConnectionPool.Open(IfxConnection connection)
at IBM.Data.Informix.IfxConnPoolManager.Open(IfxConnection connection)
at IBM.Data.Informix.IfxConnection.Open()
at DB_Connection_s.DB_Connection.GetUserSystems(String emp_num)

Now I read about this method ClearAllPools() .but i don't know when to use this method .and if this considered as a good solution to prevent the have to reset the iis to fix the request time out problem ??

cuongle
  • 74,024
  • 28
  • 151
  • 206
Anyname Donotcare
  • 11,113
  • 66
  • 219
  • 392
  • 2
    Are you able to configure the size of a connection pool? Is the Informix database server running on the same machine as IIS? If so, are you using shared memory connections to Informix? If you are using shared memory connections to a local Informix server, then you may have exceeded the number of simultaneous connections that Informix is configured to manage. You would then need to increase that configuration and restart Informix. If you're using something other than shared memory connections, there isn't an upper bound on connections in the same way. – Jonathan Leffler Sep 02 '12 at 14:37
  • `Is the Informix database server running on the same machine as IIS?` NO – Anyname Donotcare Sep 09 '12 at 09:21
  • 1
    Why don't you try Max Pool Size=600 or 1000 then? – Simon Mourier Sep 09 '12 at 17:14
  • hmmm but i think this is a big number ,the ideal is 200 !! – Anyname Donotcare Sep 10 '12 at 07:11
  • 1
    Are you sure you're not hitting a "normal" limit of your app? IIS can create many threads, especially if you have many CPU/cores. Otherwise, you probably have a missing Dispose (or lack of *using*) on the ADO.NET informix Connection object. (PS: please use the @[user] when answering to someone in comments, otherwise commenters like me are not notified of your messages) – Simon Mourier Sep 10 '12 at 12:06
  • @SimonMourier : thanks a lot but how to fix this problem , a snapshot of my dll code which emerge the exception is above ,i dispose the connection using `using` keyword !! – Anyname Donotcare Sep 10 '12 at 12:12
  • @JonathanLeffler :Could u read the comments please ? – Anyname Donotcare Sep 10 '12 at 12:13
  • 2
    @just_name - It could basically be 3 things: 1) a missing using/dispose, 2) a real limit that you can overcome changing the max pool size, 3) a bug in the ADO.NET provider. I would start with a very small app to try to reproduce the problem, and if it works fine, then review your code again. – Simon Mourier Sep 10 '12 at 12:15
  • 1
    What I know about .NET can be written on a postage stamp in 72 point text. I don't see any information that helps me to help you; you need someone who understands Windows and .NET (and preferably Informix too). That someone ain't me. – Jonathan Leffler Sep 10 '12 at 14:01
  • I think the answer to this question lies in the answers you received for a previous question you asked. [dispose-the-connection-or-close-the-connection?](http://stackoverflow.com/questions/11448335/dispose-the-connection-or-close-the-connection) – Joe R. Sep 12 '12 at 04:45

1 Answers1

1

You can call ClearAllPools() when you dont have any active connection.

also check out http://www.codeproject.com/Articles/46267/Connection-Pooling-in-ASP-NET

Ensure that your application closes all database connections correctly and consistently.

Ensure that the database is online.

Increase the connection timeout.

The error pattern indicates that connections are "leaked" over a long period. To fix this problem, ensure that your application closes all database connections correctly and consistently.

The exception does not indicate that the database is offline. The exception indicates a connection pool problem.

Learning
  • 19,469
  • 39
  • 180
  • 373