Re: Callbacks for NOTIFY

From: Johann Uhrmann <johann(dot)uhrmann(at)xpecto(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Callbacks for NOTIFY
Date: 2003-08-29 11:25:16
Message-ID: 3F4F381C.9020108@xpecto.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Scot P. Floess wrote:
> I was wondering, have y'all considered using JMS to broadcast after manipulating the database? Or is the requirement specifically for the DB to notify?

The requirement is that notify-commands cause a callback method to
be called.

JMS might be a solution for some cases, but not all Java applications
run in an environment with JMS.
In addition, JMS is limited to Java whereas notify can be executed by
any DB client or even by the database itself (trigger).

Let me provide an example:

Imagine a database with a table for user privileges. Clients might want
to cache that table in order to hold the number of concurrent connections
low. However, it is mandatory that clients are informed about changes
in that table. A trigger that executes a notify on inserts/updates/deletes
on that table would inform the clients about the change. (No matter
who did the change - it could even be through the psql interface.)

JMS and an application server architecture are definitely the solution to
choose for a big number of applications but there are also many scenarios
where a "notify-callback" would be handy.

Kind regards,

Johann Uhrmann

P.S.:
Using the "notify-callback" functionality in a J2EE environment would not
be allowed because it is similar to the creation of new threads which is
definitely not allowed for Enterprise Beans.
But that does not mean that the driver itself could not be used by an
j2ee server - it is merely that callback registration which would be
off limits.

--
Johann Uhrmann
xpecto AG | Lindenstrasse 81 | D-84030 Ergolding
Telefon: 0700 xpecto 00 (0700 973286 00)
Telefax: 0700 xpecto 10 (0700 973286 10)
Internet: http://www.xpecto.com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Toby Doig 2003-08-29 13:55:18 Re: Help - lo_close: invalid large obj descriptor
Previous Message Dave Cramer 2003-08-29 08:51:48 Re: Stored Functions