Search Postgresql Archives

Re: Connecting to NOTIFY with telnet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff,

On Sat, May 4, 2019 at 11:34 AM Jeff Janes <jeff.janes@xxxxxxxxx> wrote:
On Sat, May 4, 2019 at 1:49 PM Igal Sapir <igal@xxxxxxxxx> wrote:
Christoph,

On Sat, May 4, 2019 at 10:44 AM Christoph Moench-Tegeder <cmt@xxxxxxxxxxxxxx> wrote:
## Igal Sapir (igal@xxxxxxxxx):

> My main "issue" is that the official pgjdbc driver does not support the
> notifications with listen and I was trying to figure out why.

https://jdbc.postgresql.org/documentation/head/listennotify.html


I should have been more explicit.  My main issue is with the following statement from the link that you posted:

> A key limitation of the JDBC driver is that it cannot receive asynchronous notifications and must poll the backend to check if any notifications were issued

Polling is much less efficient than event handling and I'm sure that there's a major performance hit with that.

Isn't that addressed here?:

                // If this thread is the only one that uses the connection, a timeout can be used to
                // receive notifications immediately:
                // org.postgresql.PGNotification notifications[] = pgconn.getNotifications(10000);


It "helps", but it's still not the same as keeping the connection open and receiving messages in real time.

Looking at the documentation of pgjdbc-ng [1] it looks quite impressive.  I'm thinking to try it out and possibly even try to benchmark it for performance against the official JDBC driver.

Igal

[1] http://impossibl.github.io/pgjdbc-ng/docs/current/user-guide/#extensions-notifications
 
Cheers,

Jeff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux