Timing of notice delivery

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Timing of notice delivery
Date: 2011-02-01 23:51:33
Message-ID: 4D484825020000250003A151@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

In 9.0.3 with postgresql-9.0-801.jdbc4.jar (if version matters), I'm
wondering whether a single connection which has a listener
registered, and within a transaction generates notifications, can
commit and immediately request notifications with assurance that all
notifications generated before the commit will be delivered on that
first getNotifications() invocation after the commit.

In other words, all on one thread, all on one connection:

-- setup
Execute LISTEN on the connection.
conn.setAutoCommit(false);
-- each transaction
execute statements which fire triggers which NOTIFY.
conn.commit();
conn.getNotifications();

Can I count on all notifications triggered during a transaction
being delivered in the last step?

If not, does running one dummy query, committing, and invoking
getNotifications() again ensure that I have them all?

If not, is there any way to determine when all notifications from
that transaction have been delivered?

Remember: all on one thread, all on one connection.

-Kevin

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2011-02-02 00:16:49 Re: Timing of notice delivery
Previous Message Maciek Sakrejda 2011-02-01 22:52:27 Re: My query table aliases don't exist in my application