Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7D7381337B93; Wed, 13 Apr 2011 06:57:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 14881-09; Wed, 13 Apr 2011 09:57:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.cisx.com (failover.mail.cisx.com [78.41.6.83]) by mail.postgresql.org (Postfix) with ESMTP id 3A0901337B80; Wed, 13 Apr 2011 06:57:12 -0300 (ADT) Received: from DEVELOP1 ([192.168.100.50]) by mail.cisx.com (8.13.1/8.13.1) with SMTP id p3D9v6ci028392; Wed, 13 Apr 2011 10:57:11 +0100 Message-ID: <6A526FFBDB9D4EE2947C4E5E282530E3@DEVELOP1> From: "Donald Fraser" To: "[JDBC]" , "[ADMIN]" References: <00C88DF265FC483EBE2322C834A76698@DEVELOP1> <4DA42B42020000250003C6F8@gw.wicourts.gov> <3670D8885C9549A393E47A0C1582B07A@DEVELOP1> <4DA45EA2020000250003C711@gw.wicourts.gov> Subject: Re: Missing documentation for error code: 80S01 Date: Wed, 13 Apr 2011 10:57:05 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.461 tagged_above=-10 required=5 tests=BAYES_00=-1.9, STOX_REPLY_TYPE=0.439 X-Spam-Level: X-Archive-Number: 201104/121 X-Sequence-Number: 37302 From: "Kevin Grittner" > "Donald Fraser" wrote: > >> the JDBC driver does know that the server has terminated the >> connection [...] (via end of stream or EOF). >> >> Is the error class "57" a better prefix for this type of error? > > Possibly. Is it really true that the client will see a clean close > for a canceled query or a clean server shutdown and never see a > clean close of the TCP connection from the server side for other > reasons? Technically yes. When performing a read on the socket you get -1 indicating EOF or remote socket closed. You don't get an IO error. The difficult part is what was the client doing when the server closes the socket? If the client wasn't doing anything then the next likely action a client would perform is to execute a query which would involve writing to the socket first and in this case you will get a broken pipe IO exception, rather than remote socket closed. If the client had already executed a query and was attempting to read response data then you get remote socket closed. I would like to propose that when a "remote socket closed" is detected that the JDBC driver uses a different error code to the one used for IO exceptions. Currently for IO exceptions error code is: "08S01" For detection of remote socket closed, the error code should be different - may be "08S02" or "57P00"? I'm not really sure where or how these numbers are supposed to be used/generated. The "08" class would seem to be the most appropriate since it is connection related. Regards Donald Fraser