Re: an efficient way of checking if the connection to a db

From: Kris Jurka <books(at)ejurka(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Assad Jarrahian <jarraa(at)gmail(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: an efficient way of checking if the connection to a db
Date: 2005-12-15 23:36:53
Message-ID: Pine.BSO.4.61.0512151834330.1833@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Thu, 15 Dec 2005, Tom Lane wrote:

> I think you've got a problem on the driver side.
> Here, strace'ing a program doing PQexec(conn, "") shows:
>
> 17:53:33.677241 send(3, "Q\0\0\0\5\0", 6, 0) = 6
> ...
> 17:53:33.678085 recv(3, "I\0\0\0\4Z\0\0\0\5I", 16384, 0) = 11
>
> which looks like EmptyQueryResponse followed by ReadyForQuery to me.

This was indeed a driver problem. With V2 protocol EmptyQuery is followed
by a single null byte, but the driver was expecting a four byte message
length, like the V3 protocol sends.

Fixed in 8.0, 8.1, and head.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Guillaume Cottenceau 2005-12-16 07:57:38 Re: an efficient way of checking if the connection to a db is actually open
Previous Message Tom Lane 2005-12-15 22:54:21 Re: an efficient way of checking if the connection to a db