pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feednon-polling LISTEN
2+ messages / 2 participants
[nested] [flat]
* non-polling LISTEN
@ 2005-08-19 13:49 pgsql@toddb.mailshell.com
2005-08-19 17:24 ` Re: non-polling LISTEN Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 2+ messages in thread
From: pgsql@toddb.mailshell.com @ 2005-08-19 13:49 UTC (permalink / raw)
To: pgsql-jdbc
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)
If this is only possible (if it is possible at all) via C or C++, I would be interested in knowing that as well.
Thank you.
Todd
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: non-polling LISTEN
2005-08-19 13:49 non-polling LISTEN pgsql@toddb.mailshell.com
@ 2005-08-19 17:24 ` Kris Jurka <books@ejurka.com>
0 siblings, 0 replies; 2+ messages in thread
From: Kris Jurka @ 2005-08-19 17:24 UTC (permalink / raw)
To: pgsql@toddb.mailshell.com; +Cc: pgsql-jdbc
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-08-19 17:24 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-08-19 13:49 non-polling LISTEN pgsql@toddb.mailshell.com
2005-08-19 17:24 ` Kris Jurka <books@ejurka.com>
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