Re: PGConnection.getNotifications(0) doesn't block - Mailing list pgsql-jdbc

From rob stone
Subject Re: PGConnection.getNotifications(0) doesn't block
Date
Msg-id e37e010810077db4ef0c33e045c0657de85bda1d.camel@tpg.com.au
Whole thread Raw
In response to PGConnection.getNotifications(0) doesn't block  (Pawel Veselov <pawel.veselov@gmail.com>)
Responses Re: PGConnection.getNotifications(0) doesn't block
List 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





pgsql-jdbc by date:

Previous
From: Pawel Veselov
Date:
Subject: Re: PGConnection.getNotifications(0) doesn't block
Next
From: Pawel Veselov
Date:
Subject: Re: PGConnection.getNotifications(0) doesn't block