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