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