Re: Problem with Async (multiple) notifications

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Andres Olarte <olarte(dot)andres(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Problem with Async (multiple) notifications
Date: 2005-06-25 00:55:02
Message-ID: 42BCAB66.3050707@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2005-06-25 04:14:25 Re: Problem with Async (multiple) notifications
Previous Message Andres Olarte 2005-06-24 23:39:54 Problem with Async (multiple) notifications