Re: Timing of notice delivery

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Timing of notice delivery
Дата
Msg-id 6364.1296606710@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Timing of notice delivery  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-jdbc
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> 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?

The backend will deliver all such notifies after returning the COMMIT's
command-complete response message, but before it delivers ReadyForQuery.
If JDBC waits for ReadyForQuery before believing the operation is
complete, you should see them reliably.

I believe that the situation for incoming notifies from other sessions
is a bit less predictable, though --- it looks like those can get sent
*after* ReadyForQuery, even if they arrived beforehand.

            regards, tom lane

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Timing of notice delivery
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Timing of notice delivery