From: Kris Jurka <books@ejurka.com>
To: pgsql@toddb.mailshell.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: non-polling LISTEN
Date: Fri, 19 Aug 2005 12:24:01 -0500 (EST)
Message-ID: <Pine.BSO.4.62.0508191213220.24486@leary.csoft.net> (raw)
In-Reply-To: <1124459398.4305e38681665@www.mailshell.com>
References: <1124459398.4305e38681665@www.mailshell.com>
On Fri, 19 Aug 2005 pgsql@toddb.mailshell.com wrote:
> I would like to be able to "watch" a table and be informed when a row is
> updated. I have seen the LISTEN/NOTIFY option, but it appears to be a
> polling arrangement. I will have 200 or so individual programs polling
> at 10 times a second, which seems like a lot of overhead. I would
> instead like to have each program perform something like a select(), and
> just block until the table updates. Is there are way to do this via the
> JDBC? (Our application is in Java)
The cvs version of the driver allows polling on the client side only that
doesn't require hitting the database. So your code polls the JDBC driver,
but the driver doesn't need to actually poll the database. A true
select() type solution would require moving to java.nio, but that is still
a ways away as we want to retain support for older JDKs.
http://archives.postgresql.org/pgsql-jdbc/2005-04/threads.php#00054
Kris Jurka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: books@ejurka.com, pgsql@toddb.mailshell.com
Subject: Re: non-polling LISTEN
In-Reply-To: <Pine.BSO.4.62.0508191213220.24486@leary.csoft.net>
References: <1124459398.4305e38681665@www.mailshell.com> <Pine.BSO.4.62.0508191213220.24486@leary.csoft.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox