Re: problem with notify/listen

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: problem with notify/listen
Дата
Msg-id 24756.1011108351@sss.pgh.pa.us
обсуждение исходный текст
Ответ на problem with notify/listen  (Barry Lind <barry@xythos.com>)
Список pgsql-hackers
Barry Lind <barry@xythos.com> writes:
> If I run jdbc with setAutoCommit=true then notifications work as 
> expected, however if I run with setAutoCommit=false then notifications 
> are not being sent from the backend to the client.

You are aware that notifications are only sent at transaction commit,
right?

> The only thing that is unusual about this is that the 
> "commit;begin;" command string is sent to the server as a single query 
> to be processed.

Hm.  The response to this string (assuming that there's a notify
waiting) would look like
N foo            (NOTIFY)C COMMIT        (commit command complete)C BEGIN            (begin command complete)Z
 (ready for new query)
 

(that's from memory, so forgive any minor inaccuracy).  I speculate that
either JDBC or your test code is dropping the NOTIFY in this situation.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 7.1 vs. 7.2 on AIX 5L
Следующее
От: Tom Lane
Дата:
Сообщение: Re: FATAL 1: Relation 'pg_shadow' does not exist