all pooled connections were in use

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
uniplan
Posts: 3
Joined: Wed 18 Apr 2012 11:13
Location: Scafati SA Italy
Contact:

all pooled connections were in use

Post by 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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by 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

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

Post by 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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by 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.

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

Post by uniplan » Mon 23 Apr 2012 13:57

Thanks.

Post Reply