From: J.Kraaijeveld at Askesis.nl (Joost Kraaijeveld) Date: Sun, 13 Aug 2006 14:13:48 +0200 Subject: [Pljava-dev] Notify/Listen In-Reply-To: <75F39425D1954A4380D5C9E1D630CDC903C30CB4@C2A007.stratford.auto.cooperintra.ctb> References: <75F39425D1954A4380D5C9E1D630CDC903C30CB4@C2A007.stratford.auto.cooperintra.ctb> Message-ID: <1155471228.5894.8.camel@panoramix> Hi John, On Wed, 2006-08-09 at 12:08 -0400, Burtenshaw, John J. wrote: > > Has anyone ever used the Notify/Listen mechanism in pljava? How would > you implement a client program that would do an sql Listen? > Apparently according to the Postgresql docs there are functions that > need to be called periodically to see if an event has occured or not > (i.e. PQnotifies in libpq) I do use notify/listen extensively thought not in pljava but in JBoss using a MBean as a listener, which is polling in a separate thread. The notify is done in a psql trigger. If you want I can send you the MBean with the code, although it is very similar to the jdbc example here: http://jdbc.postgresql.org/documentation/81/listennotify.html#listen-notify-example -- Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 web: www.askesis.nl