Page 1 of 1

Options.MultipleConnections

Posted: Mon 07 Jun 2021 07:23
by apriem
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!

Re: Options.MultipleConnections

Posted: Tue 08 Jun 2021 04:43
by evgeniym
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

Re: Options.MultipleConnections

Posted: Tue 08 Jun 2021 14:37
by apriem
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?

Re: Options.MultipleConnections

Posted: Wed 09 Jun 2021 09:21
by evgeniym
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