PgDAC in multi-thread environment does not work properly

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
IMECS
Posts: 2
Joined: Tue 12 Jun 2018 17:39

PgDAC in multi-thread environment does not work properly

Post by IMECS » Tue 12 Jun 2018 17:45

I have a problem with PgDAC (5.1.5) in a multi-thread environment. Each thread creates an own connection with an own SELECT-query, opens that query and iterates through it by using Eof and Next. While iterating it reads all the data from the records' fields. The queries are running through large tables, that's why multiple threads are required.
If only one thread is started the iteration (including reading data) lasts about 5 seconds. If two threads are started each thread lasts about 10 seconds. And if three threads are started each lasts about 15 seconds.
So it looks as if there is something in PgDAC that locks the threads and makes them do their work sequentially.
My expectation was that the iteration within a thread would only take about 5 seconds regardless of the number of threads.
How can this be solved?

IMECS
Posts: 2
Joined: Tue 12 Jun 2018 17:39

Re: PgDAC in multi-thread environment does not work properly

Post by IMECS » Mon 18 Jun 2018 18:21

Good day,

I wrote the support, too but still did not receive any answer. I still have no experience with the support but usually I get from all component makers within 2 days a response. To clarify the problem: The query in the threads is always the same over a large table. I think it is clear to use all CPU cores (for each one thread) to process everything as soon as possible. But the locking of PgDAC is not useful and also I did not await such a behavior.

Any help and fixes from the support would be appreciated.

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: PgDAC in multi-thread environment does not work properly

Post by Stellar » Wed 20 Jun 2018 10:16

Unfortunately, we can't reproduce the issue. To investigate this behavior of PgDAC, please compose a small sample demonstrating the issue and send it to us, including database objects creating scripts. You can send the project using the contact form at our website:
devart.com/company/contactform.html .

Post Reply