Re: PGConnection.getNotifications(0) doesn't block

From: rob stone <floriparob(at)tpg(dot)com(dot)au>
To: Pawel Veselov <pawel(dot)veselov(at)gmail(dot)com>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PGConnection.getNotifications(0) doesn't block
Date: 2023-08-04 08:47:43
Message-ID: e37e010810077db4ef0c33e045c0657de85bda1d.camel@tpg.com.au
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello,

On Thu, 2023-08-03 at 16:04 +0200, Pawel Veselov wrote:
> Hello.
>
> I'm implementing a bit that is expected to wait for published channel
> notifications,
> and once there are any - process them.
>
> I'm using PGConnection.getNotifications(0), but that immediately
> returns an empty
> array, and doesn't block like JavaDoc says it should.
>
> I'm on 42.6.0.
>
> What am I missing?
>
> Thank you.
>
>

Have you read the JDBC docs
https://jdbc.postgresql.org/documentation/server-prepare
which has a section about Listen/Notify?

HTH

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Pawel Veselov 2023-08-04 09:49:34 Re: PGConnection.getNotifications(0) doesn't block
Previous Message Pawel Veselov 2023-08-03 14:39:18 Re: PGConnection.getNotifications(0) doesn't block