pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedone more question about LISTEN / NOTIFY
2+ messages / 2 participants
[nested] [flat]
* one more question about LISTEN / NOTIFY
@ 2010-08-08 02:40 max <maxbox@directbox.com>
2010-08-08 05:43 ` Re: one more question about LISTEN / NOTIFY Craig Ringer <craig@postnewspapers.com.au>
0 siblings, 1 reply; 2+ messages in thread
From: max @ 2010-08-08 02:40 UTC (permalink / raw)
To: pgsql-jdbc
Hello,
I asked about the Listen / Notify commands some weeks ago. I decided to
give it a trial.
But I have one more question about it. What happens to notifications if
the connection from a listener application disconnects unexpected. Does
PostgreSQL store all notifications that are triggered during this period
and submit it to the next listener that (re)connect? Or can I lose
notifications if something unexpected happened with my connection?
Thanks,
Max
PS: the PgNotification utilities from Craig Ringer are a little too much
for my purpose ;)
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: one more question about LISTEN / NOTIFY
2010-08-08 02:40 one more question about LISTEN / NOTIFY max <maxbox@directbox.com>
@ 2010-08-08 05:43 ` Craig Ringer <craig@postnewspapers.com.au>
0 siblings, 0 replies; 2+ messages in thread
From: Craig Ringer @ 2010-08-08 05:43 UTC (permalink / raw)
To: max <maxbox@directbox.com>; +Cc: pgsql-jdbc
On 08/08/10 10:40, max wrote:
> Hello,
>
> I asked about the Listen / Notify commands some weeks ago. I decided to
> give it a trial.
> But I have one more question about it. What happens to notifications if
> the connection from a listener application disconnects unexpected. Does
> PostgreSQL store all notifications that are triggered during this period
> and submit it to the next listener that (re)connect? Or can I lose
> notifications if something unexpected happened with my connection?
You lose notifications during any period you don't have a connection.
Usually you'd be re-reading anything of interest from the database if
you have to reconnect, as any operation on the old connection would've
failed and you'd have to re-try your transaction. You'd be re-populating
any caches, etc.
In my own app, if I lose a connection I re-issue LISTEN s on any keys of
interest, *then* SELECT them to refresh the copies my app has in case
they've changed. If you're using listen/notify as a change notification
system that works great.
If you're trying to use listen/notify as a message queuing mechanism,
you should probably look at dedicated queuing systems. Building your own
queuing system is harder than you'd think, and listen/notify is not
particularly well suited to reliable message queuing.
--
Craig Ringer
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2010-08-08 05:43 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-08-08 02:40 one more question about LISTEN / NOTIFY max <maxbox@directbox.com>
2010-08-08 05:43 ` Craig Ringer <craig@postnewspapers.com.au>
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