TUniAlerter causing 2 sessions in Postgresql

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
plevrier
Posts: 4
Joined: Fri 16 Dec 2016 09:03

TUniAlerter causing 2 sessions in Postgresql

Post by plevrier » Tue 29 Mar 2022 11:23

Hi all,

I added simple interapplication-messaging into my application using TUniAlerter. It works fine but I get 2 sessions extra per application instance. Is this normal ? I would expect only one extra session.

A simple form with a TUniConnection, TPostgreSQLUniProvider and a TUniAlerter will already show this behaviour.

Regards,
Pascal

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

Re: TUniAlerter causing 2 sessions in Postgresql

Post by evgeniym » Thu 31 Mar 2022 11:03

Hi Pascal!
Thank you for contacting us!
Please note that PostgreSQL has a number of limitations that we cannot influence. In particular, according to the PostgreSQL documentation https://www.postgresql.org/docs/14/sql-listen.html , a separate connection must be opened to listen a channel.

Thus, when using TUniAlerter, two connections are opened, one for listening to the channel, the second one is for sending messages.

Best regards,
Evgeniy

Post Reply