Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When we can use ClearAllPools method?

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

like image 751
Anyname Donotcare Avatar asked Sep 02 '12 12:09

Anyname Donotcare


1 Answers

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.

like image 52
Learning Avatar answered Oct 03 '22 07:10

Learning