X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6ED2C52835 for ; Sat, 25 Jun 2005 01:14:44 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 11883-02 for ; Sat, 25 Jun 2005 04:14:42 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0D35452832 for ; Sat, 25 Jun 2005 01:14:41 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j5P4EPIQ017990; Sat, 25 Jun 2005 00:14:25 -0400 (EDT) To: Andres Olarte Cc: pgsql-jdbc@postgresql.org Subject: Re: Problem with Async (multiple) notifications In-reply-to: <3fccaa6905062416392e578f58@mail.gmail.com> References: <3fccaa6905062416392e578f58@mail.gmail.com> Comments: In-reply-to Andres Olarte message dated "Fri, 24 Jun 2005 17:39:54 -0600" Date: Sat, 25 Jun 2005 00:14:25 -0400 Message-ID: <17989.1119672865@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/129 X-Sequence-Number: 13091 Andres Olarte 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