Re: Unexpected EOF on client connection

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthias Brunner <mb(at)blumenstrasse(dot)vol(dot)at>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Unexpected EOF on client connection
Date: 2002-08-14 16:36:18
Message-ID: 9144.1029342978@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Matthias Brunner <mb(at)blumenstrasse(dot)vol(dot)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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Alejandro Vergara 2002-08-14 19:10:33 Question about JDBC?
Previous Message Barry Lind 2002-08-14 15:58:01 Re: Unexpected EOF on client connection