Re: Problem with Async (multiple) notifications - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Problem with Async (multiple) notifications
Date
Msg-id 42BCAB66.3050707@opencloud.com
Whole thread Raw
In response to Problem with Async (multiple) notifications  (Andres Olarte <olarte.andres@gmail.com>)
List pgsql-jdbc
Andres Olarte wrote:
> I've been playing with async notifications lately, and I've found a
> small problem: when several notifications are issued at once (for
> example within a transaction) normally only one of those gets to the
> client.  The rest of the notifications are not received until
> something happens on the connection, for example a query or another
> notification.

Ok, this looks like a bug in some newish code that allows you to do this
at all (previously, you *always* had to issue a query to notice async
notifications). It's checking only for new data available on the
underlying socket, and not our input buffer -- if we read multiple
notifications into our input buffer, consuming all the data at the
socket level, we only process one before returning to the client, and
don't look for any more until more data arrives at the socket level.

I've applied a fix to CVS HEAD (only org/postgresql/core/PGStream.java
affected), can you try that out?

-O

pgsql-jdbc by date:

Previous
From: Andres Olarte
Date:
Subject: Problem with Async (multiple) notifications
Next
From: Tom Lane
Date:
Subject: Re: Problem with Async (multiple) notifications