Re: Questions about Listen/Notify mechanism

From: "Mikael" <mikael-aronsson(at)telia(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Questions about Listen/Notify mechanism
Date: 2010-07-18 16:06:13
Message-ID: 88EE005181834531B77043041013169F@emea.itt.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Yes, you do have to poll with a "SELECT 1" to get the notifications, this is
very quick and no problem at all,
and you can have lots of LISTEN/NOTIFY without adding much load on the
network, this works very
good so I don't see why you cannot use it.

Mikael

----- Original Message -----
From: "max" <maxbox(at)directbox(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Sent: Sunday, July 18, 2010 4:33 AM
Subject: [JDBC] Questions about Listen/Notify mechanism

> Hallo,
>
> I need to write a Java app which deals with as low as possible network
> resources. That's why the database should inform my Java app about
> changes and I does not have to poll the database every 5 seconds to
> recognize them.
> I read the Postgresql-JDBC documentation about the Listen/Notify
> commands. I do not understand that note
>
> "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."
>
> Does that mean that the driver will poll the database, e.g. every 5
> seconds? If so, that would not be acceptable for me, because that is
> exactly what I want to avoid. The only advantage of using Listen/Notify
> in that case would be that I don't need an extra notification table that
> my trigger would fill. Am I wrong? Oo
>
> I hope somebody can help me with that.
>
> Regard,
>
> Max
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2010-07-18 22:15:02 Re: Questions about Listen/Notify mechanism
Previous Message max 2010-07-18 02:33:30 Questions about Listen/Notify mechanism