Options.MultipleConnections

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
apriem
Posts: 20
Joined: Mon 06 Oct 2014 07:26

Options.MultipleConnections

Post by apriem » Mon 07 Jun 2021 07:23

Hello,

We just upgraded the PgDac component in our Delphi projects to the latest version.

I noticed that PgDac now creates extra db connnections implicitly. PG connections are quite expensive, so I got to investigating why these connections are created. I found info about a new "Options.MultipleConnections" property in your documentation.

The documentation says: Use the MultipleConnections property to enable or disable the creation of an additional internal connection for TPgQuery, when necessary. The default value is True.

Can you tell my what this property does exactly? And why you need it?

I want to disable it, since we don't want all these extra db connections. We want to minimize the number of db connections.

But I do want to know what I lose when I disable it.

I hope you can explain what you use the extra connections for and what we lose if we disable the property.

Thanks in advance!

evgeniym
Devart Team
Posts: 103
Joined: Thu 13 May 2021 07:08

Re: Options.MultipleConnections

Post by evgeniym » Tue 08 Jun 2021 04:43

Hi there,

One of PostgreSQL’s features is that under certain conditions, in order to execute a query and receive results, it’s required to create a separate connection to server. This is PostgreSQL specific and, unfortunately, we cannot affect this.

When MultipleConnections = True, each request may create a separate connection for itself, and requests can work without interfering with each other and without changing the connection. If MultipleConnections = False, the number of created connections is limited as much as possible, this means that all queries work over practically one connection.

If the number of connections is important for you, please set this property to false.

Best regards,
Evgeniy

apriem
Posts: 20
Joined: Mon 06 Oct 2014 07:26

Re: Options.MultipleConnections

Post by apriem » Tue 08 Jun 2021 14:37

Can you elaborate on those conditions, please?

This property was not available in earlier PgDac builds, and I cannot find anything in PostgreSQL documentation that mentions added functionality that requires extra connections for querying data...

When we set the property to False, what consequences would that have specifically and under what conditions?

evgeniym
Devart Team
Posts: 103
Joined: Thu 13 May 2021 07:08

Re: Options.MultipleConnections

Post by evgeniym » Wed 09 Jun 2021 09:21

Hey,
Please note that multiple connections were always allowed in previous versions.
In order to provide more control to users over the number of opened connections MultipleConnections property was added, which also allows multiple connections to retain the behavior that was in previous versions of PgDAC by default.
You may find more information about MultipleConnections from our documentation:
https://www.devart.com/pgdac/docs/devar ... ctions.htm

Regards,
Evgeniy

Post Reply