Page 1 of 1
all pooled connections were in use
Posted: Wed 18 Apr 2012 11:20
by uniplan
I try to open repeatedly a connetction to a PostGresSql db from a vb.net application.
Sometime I have this message:
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 is the problem?
Regards.
Posted: Thu 19 Apr 2012 12:15
by Shalex
This error states that you have run out of connections available. To solve the problem increase Max Pool Size connection string parameter value. The default value is 100. Another way to get extra connections is to clear one or all of the pools. Or you can turn connection pooling off using Pooling connection string parameter.
Also make sure that you close your connections in the code (when they are not needed any more) to return them in the pool.
http://www.devart.com/dotconnect/postgr ... Q.html#q52
Posted: Thu 19 Apr 2012 17:13
by uniplan
Another way to get extra connections is to clear one or all of the pools. Or you can turn connection pooling off using Pooling connection string parameter.
Can you post an example to do it?
Thanks.
Posted: Mon 23 Apr 2012 12:19
by Shalex
uniplan wrote:Another way to get extra connections is to clear one or all of the pools. Or you can turn connection pooling off using Pooling connection string parameter.
Can you post an example to do it?
1. Clearing one pool:
Code: Select all
Devart.Data.PostgreSql.PgSqlConnection.ClearPool(connObject);
2. Clearing all the pools:
Code: Select all
Devart.Data.PostgreSql.PgSqlConnection.ClearAllPools();
3. Turning connection pooling off: include the "Pooling=false;" option in your connection string.
Posted: Mon 23 Apr 2012 13:57
by uniplan
Thanks.