agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] Notify/Listen
3+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] Notify/Listen
@ 2006-08-09 16:08  
  0 siblings, 2 replies; 3+ messages in thread

From:  @ 2006-08-09 16:08 UTC (permalink / raw)


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)

Regards,
John Burtenshaw


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20060809/a35f681c/attachment.html;



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] Notify/Listen
@ 2006-08-13 12:13  
  parent: 
  1 sibling, 0 replies; 3+ messages in thread

From:  @ 2006-08-13 12:13 UTC (permalink / raw)

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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] Notify/Listen
@ 2006-08-14 22:53  
  parent: 
  1 sibling, 0 replies; 3+ messages in thread

From:  @ 2006-08-14 22:53 UTC (permalink / raw)

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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-08-14 22:53 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-08-09 16:08 [Pljava-dev] Notify/Listen 
2006-08-13 12:13 ` 
2006-08-14 22:53 ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox