pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Olarte <olarte.andres@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Problem with Async (multiple) notifications
Date: Sat, 25 Jun 2005 00:14:25 -0400
Message-ID: <17989.1119672865@sss.pgh.pa.us> (raw)
In-Reply-To: <3fccaa6905062416392e578f58@mail.gmail.com>
References: <3fccaa6905062416392e578f58@mail.gmail.com>

Andres Olarte <olarte.andres@gmail.com> writes:
> I've been playing with async notifications lately, and I've found a
> small problem: when several notifications are issued at once (for
> example within a transaction) normally only one of those gets to the
> client.

The documentation:
http://www.postgresql.org/docs/8.0/static/sql-notify.html
quoth:
> NOTIFY behaves like Unix signals in one important respect: if the same
> notification name is signaled multiple times in quick succession,
> recipients may get only one notification event for several executions of
> NOTIFY. So it is a bad idea to depend on the number of notifications
> received. Instead, use NOTIFY to wake up applications that need to pay
> attention to something, and use a database object (such as a sequence)
> to keep track of what happened or how many times it happened.

Are you sure you are following this advice?

(In particular, I can absolutely positively guarantee that N NOTIFYs
executed within a single transaction have the same effect as one
NOTIFY.  This is not a bug, it is the design intention.)

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <17989.1119672865@sss.pgh.pa.us>
Permalink:  ../17989.1119672865@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17989.1119672865@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, olarte.andres@gmail.com
  Subject: Re: Problem with Async (multiple) notifications
  In-Reply-To: <17989.1119672865@sss.pgh.pa.us>
  References: <3fccaa6905062416392e578f58@mail.gmail.com> <17989.1119672865@sss.pgh.pa.us>

* 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