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

From Pawel Veselov
Subject Re: PGConnection.getNotifications(0) doesn't block
Date
Msg-id CAMnJ+Bcb3CO-B9M-hwqOdaTvytUDReA-7S2xd2GA00AapXraLw@mail.gmail.com
Whole thread Raw
In response to PGConnection.getNotifications(0) doesn't block  (Pawel Veselov <pawel.veselov@gmail.com>)
List pgsql-jdbc
Hello.

On Thu, Aug 3, 2023 at 4:04 PM Pawel Veselov <pawel.veselov@gmail.com> 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?

The transaction state is not IDLE, that's what's missing.
But JavaDoc doesn't mention that bit.



pgsql-jdbc by date:

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