From: thomas at tada.se (Thomas Hallgren) Date: Tue, 15 Aug 2006 00:53:17 +0200 Subject: [Pljava-dev] Notify/Listen In-Reply-To: <75F39425D1954A4380D5C9E1D630CDC903C30CB4@C2A007.stratford.auto.cooperintra.ctb> References: <75F39425D1954A4380D5C9E1D630CDC903C30CB4@C2A007.stratford.auto.cooperintra.ctb> Message-ID: <44E0FEDD.7030005@tada.se> 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 doubt I can make LISTEN work in PL/Java. To my knowledge, there's no support for it in the underlying SPI routines and implementing such support would imply a multi-threaded backend. Keep in mind that PL/Java executes functions within a transaction. It can never start a transaction on its own behalf. It is fundamentally different from a client. Regards, Thomas Hallgren