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

From: Pawel Veselov <pawel(dot)veselov(at)gmail(dot)com>
To: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PGConnection.getNotifications(0) doesn't block
Date: 2023-08-03 14:39:18
Message-ID: CAMnJ+Bcb3CO-B9M-hwqOdaTvytUDReA-7S2xd2GA00AapXraLw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello.

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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message rob stone 2023-08-04 08:47:43 Re: PGConnection.getNotifications(0) doesn't block
Previous Message Pawel Veselov 2023-08-03 14:04:08 PGConnection.getNotifications(0) doesn't block