Re: Detecting 'socket errors' - closing the Connection object

Поиск
Список
Период
Сортировка
От Fernando Nasser
Тема Re: Detecting 'socket errors' - closing the Connection object
Дата
Msg-id 3F1D74A2.3060504@redhat.com
обсуждение исходный текст
Ответ на Fix for receiving empty query errors.  (Kim Ho <kho@redhat.com>)
Список pgsql-jdbc
David Wall wrote:
>>When we get the SQLSTATE patch in you'll be able to do:
>>
>>if ((e.getSQLState() != null) && (e.getSQLState().equals("08S01")))
>>throw new ExplainException("Communication link error: " + e.getMessage());
>
>
> Thanks, Fernando.  Unfortunately, this will be a postgresql-ism, not a JDBC
> library-ism, and it will likely require that the user be on a particular
> version of the database, too (or is this bit going to work even on 7.3 and
> pre 7.3 versions too?).  I'm looking for something that doesn't require a
> special patch for each of the myriad databases our customers use (MSFT SQL
> Server, Oracle, PostgreSQL MySQL and DB2/UDB to name the current list).
>

First of all, this is plain SQL + JDBC specs.

The code falls into the "implementation defined" range, but ODBC, DB2
and Oracle use the same and my patch followed that convention (a sort of
de facto standard for some of these values not pre-defined in the SQL
standard itself).  I don't know if all vendors did the same though -- I
just checked these three.  It is a limitation of the standards that they
did not come out with a more compreheensive set of pre-defined numbers.
  I guess they do spect the applications to cope with the error code
differences somehow.

My patch was originally against 7.3, but it only includes the conditions
detected by the driver.  The backend will only spit SQLSTATEs from 7.4
on (i.e., V# protocol).






--
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


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

Предыдущее
От: Peter Kovacs
Дата:
Сообщение: Re: Prepared Statements
Следующее
От: Oana Mitrea
Дата:
Сообщение: unsubscribe me please