Connection Life Time

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Ekki
Posts: 34
Joined: Sun 24 Nov 2013 18:50
Location: Ilmenau, Germany
Contact:

Connection Life Time

Post by Ekki » Mon 09 Dec 2019 17:42

Hi...

I have a special scenario where I have to open 100+ different DB connections sequentially. This causes issues with the max connection limit (default: 100) of the PostgreSQL server. Of course, I could increment this limit to let's say 200, but it's only a question of time when I have to open 200+ connections in that special use case.

Anything I can do to force the release/closing of a connection explicitly? THX IA, Ekki

Ekki
Posts: 34
Joined: Sun 24 Nov 2013 18:50
Location: Ilmenau, Germany
Contact:

Re: Connection Life Time

Post by Ekki » Mon 09 Dec 2019 21:20

On my dev machine, ClearPool(<conn>) does exactly what I was looking for. But when I did deploy the executable to the production machine, nothing did change. The connections raise up to 120 (meanwhile I did increment the connection limit to 200) and after some minutes go back to where it started (~7).

Does this make sense? What could be the reason for ignoring ClearPool() calls on the production machine?

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

Re: Connection Life Time

Post by Shalex » Fri 13 Dec 2019 19:02

1. Please use the following overload to clear the pool immediately: https://www.devart.com/dotconnect/postg ... lean).html.

2. You can control the max number of connections in the pool with the Max Pool Size connection string parameter.

3. If you do not need pooling, turn off it using "Pooling=false;" in the connection string.

Refer to https://www.devart.com/dotconnect/postg ... tring.html.

Ekki
Posts: 34
Joined: Sun 24 Nov 2013 18:50
Location: Ilmenau, Germany
Contact:

Re: Connection Life Time

Post by Ekki » Fri 13 Dec 2019 22:57

#3 solved my problem. Thx!

Post Reply