Re: implementing asynchronous notifications PLEASE CONFIRM - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: implementing asynchronous notifications PLEASE CONFIRM
Date
Msg-id Pine.BSO.4.62.0508260112370.3794@leary.csoft.net
Whole thread Raw
In response to Re: implementing asynchronous notifications PLEASE CONFIRM MY  (David Gagnon <dgagnon@siunik.com>)
Responses Re: implementing asynchronous notifications PLEASE CONFIRM MY
List 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


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Is this error correct/possible?
Next
From: David Gagnon
Date:
Subject: Re: implementing asynchronous notifications PLEASE CONFIRM MY