Re: Invalid PSQLState used in connection classes

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Invalid PSQLState used in connection classes
Дата
Msg-id alpine.BSO.2.00.1103191936050.28447@leary.csoft.net
обсуждение исходный текст
Ответ на Re: Invalid PSQLState used in connection classes  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: Invalid PSQLState used in connection classes  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc

On Tue, 8 Mar 2011, Kevin Grittner wrote:

> "Donald Fraser" <postgres@kiwi-fraser.net> wrote:
>
>> However if I have a broken network between my client and the
>> server, such that there is no route to the server, I can get a
>> ConnectException and I have not established, in any way, a
>> connection to the PostgreSQL server.
>
> 08001 - SQLCLIENT UNABLE TO ESTABLISH SQLCONNECTION
>
> Sounds better for that sort of failure.
>

Sounds reasonable to me.  Looking at the error codes used during startup,
I think we should also make some other changes at the same time.

CONNECTION_UNABLE_TO_CONNECT -> PROTOCOL_VIOLATION
CONNECTION_FAILURE -> PROTOCOL_VIOLATION
when the driver receives an unknown message.

CONNECTION_FAILURE -> CONNECTION_REJECTED
when the server doesn't support SSL, but we need a SSL connection.  I
think CONNECTION_FAILURE should only be used when something has gone wrong
after a connection has been established.

Patch attached.

Kris Jurka

Вложения

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: unwrapping InvocationTargetException in PGXAConnection.ConnectionHandler
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Failing test in org.postgresql.test.jdbc2.DateTest