mishandling of NOTICE?

Поиск
Список
Период
Сортировка
От Michael Adler
Тема mishandling of NOTICE?
Дата
Msg-id Pine.NEB.4.44.0203181332220.13132-100000@reva.sixgirls.org
обсуждение исходный текст
Ответ на minor error reporting fixes  (Liam Stewart <liams@redhat.com>)
Ответы Re: mishandling of NOTICE?  ("Dave Cramer" <Dave@micro-automation.net>)
Список pgsql-jdbc
I am not very familiar with this driver, but I thought I should point out
a potential bug. I wish I had time to do more investigationn, testing and
debugging...

I encountered a situation in which I could access the database using psql
but not the JDBC driver. This is what I think happened:

The backend issued a NOTICE message. psql handled it gracefully by
printing the message to STDOUT and providing a fine connection. JDBC
driver throws a fatal SQLException.

The following case statements may need to handle NOTICEs differently:

org.postgresql.Connection line 265:

        // As of protocol version 2.0, we should now receive the cancellation key and the pid
                int beresp = pg_stream.ReceiveChar();
                switch (beresp)
                {
                        case 'K':
                                pid = pg_stream.ReceiveInteger(4);
                                ckey = pg_stream.ReceiveInteger(4);
                                break;
                        case 'E':
                        case 'N':
                                throw new SQLException(pg_stream.ReceiveString(encoding));
                        default:
                                throw new PSQLException("postgresql.con.setup");
                }

                // Expect ReadyForQuery packet
                beresp = pg_stream.ReceiveChar();
                switch (beresp)
                {
                        case 'Z':
                                break;
                        case 'E':
                        case 'N':
                                throw new SQLException(pg_stream.ReceiveString(encoding));
                        default:
                                throw new PSQLException("postgresql.con.setup");
                }




Once again, sorry for the uninformed vaugeries. I hope this helps
somewhat.

Mike Adler


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

Предыдущее
От: Josh Burdick
Дата:
Сообщение: Re: jdbc url
Следующее
От: "Dave Cramer"
Дата:
Сообщение: Re: mishandling of NOTICE?