Re: Unexpected EOF on client connection - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: Unexpected EOF on client connection
Date
Msg-id 9144.1029342978@sss.pgh.pa.us
Whole thread Raw
In response to Unexpected EOF on client connection  (Matthias Brunner <mb@blumenstrasse.vol.at>)
List pgsql-jdbc
Matthias Brunner <mb@blumenstrasse.vol.at> writes:
> whenever I close a JDBC connection, the following log message is printed:
> DEBUG:  pq_recvbuf: unexpected EOF on client connection

This appears to be fixed in current sources, where I read:

        public void close() throws SQLException
        {
                if (pg_stream != null)
                {
                        try
                        {
                                pg_stream.SendChar('X');
                                pg_stream.flush();
                                pg_stream.close();
                        }
                        catch (IOException e)
                        {}
                        pg_stream = null;
                }
        }

        public void finalize() throws Throwable
        {
                close();
        }

Without this, destroying the JDBC connection simply results in
unceremoniously closing the TCP connection.  If you do that without
sending 'X', the backend complains ...

            regards, tom lane

pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: Unexpected EOF on client connection
Next
From: Matthias Brunner
Date:
Subject: Re: Unexpected EOF on client connection