Applications can't rely on the text of the SQLException error message to
detect that there was a communication error as it is localized (and
error messages are prone to change anyway). So, a JDBC application
cannot take the appropriate actions when an IO error occurs.
This patch makes the JDBC driver report an eof and other communication
errors using the standard SQLSTATE value:
"08S01" (connection exception-communication link failure)
which can be safely tested for in applications. Without this patch we
get null, instead of the "08S01" string, when calling getSQLState() as
the driver never sets that value.
The behavior of applications when we lose connection with the backend is
currently very bad, as there is no way to distinguish this problem from
a regular SQL error.
Red Hat Canada Ltd. E-Mail: fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
pgsql-patches by date
|Next:||From: Fernando Nasser||Date: 2002-11-20 01:33:12|
|Subject: Re: JDBC Emit SQLError code for communication errors|
|Previous:||From: Bruce Momjian||Date: 2002-11-19 17:20:49|
|Subject: Re: standardize on "canceled"|