all pooled connections were in use

all pooled connections were in use

Postby uniplan » Wed 18 Apr 2012 11:20

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.
uniplan
 
Posts: 3
Joined: Wed 18 Apr 2012 11:13
Location: Scafati SA Italy

Postby Shalex » Thu 19 Apr 2012 12:15

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
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Postby uniplan » Thu 19 Apr 2012 17:13

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.
uniplan
 
Posts: 3
Joined: Wed 18 Apr 2012 11:13
Location: Scafati SA Italy

Postby Shalex » Mon 23 Apr 2012 12:19

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.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Postby uniplan » Mon 23 Apr 2012 13:57

Thanks.
uniplan
 
Posts: 3
Joined: Wed 18 Apr 2012 11:13
Location: Scafati SA Italy


Return to dotConnect for PostgreSQL