Re: implementing asynchronous notifications PLEASE CONFIRM

From: Kris Jurka <books(at)ejurka(dot)com>
To: David Gagnon <dgagnon(at)siunik(dot)com>
Cc: Andres Olarte <olarte(dot)andres(at)gmail(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: implementing asynchronous notifications PLEASE CONFIRM
Date: 2005-08-26 06:19:38
Message-ID: Pine.BSO.4.62.0508260112370.3794@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Thu, 25 Aug 2005, David Gagnon wrote:

> I look more deeply with solution #1 but the big problem seem to be the
> lack of flexibility with the notify mechanism... In the trigger I would send
> something like
>
> NOTIFY "TABLEX:UPDATE:111";
>
> To say table row with id 111 on table X have been updated ...But I I need to
> explicitly LISTEN on a Channel (or identifier) .. How can I get this
> notification on the client.

Right, you'd have to say: LISTEN "TABLEX:UPDATE:111". Generally
LISTEN/NOTIFY is used at a much coarser grain because of this restriction
as well as the possibility of multiple notifies (for the same target)
being combined and the client only getting one notification.

Instead of listening for a very specific action, the listening code is
triggered to go figure out what happened. In your situation perhaps
flushing the entire cache for that event is best instead of trying to make
a very specific alteration.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Gagnon 2005-08-26 18:09:00 Re: implementing asynchronous notifications PLEASE CONFIRM MY
Previous Message Kris Jurka 2005-08-26 06:12:27 Re: Is this error correct/possible?