Re: an efficient way of checking if the connection to a db - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: an efficient way of checking if the connection to a db
Date
Msg-id 17890.1134687261@sss.pgh.pa.us
Whole thread Raw
In response to Re: an efficient way of checking if the connection to a db  (Kris Jurka <books@ejurka.com>)
Responses Re: an efficient way of checking if the connection to a db  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Kris Jurka <books@ejurka.com> writes:
> Testing this with the V2 protocol reveals an issue, but it looks like
> the server's fault.

> 14:33:42.550 (1)  FE=> Query("")
> 14:33:42.550 (1)  <=BE EmptyQuery

> At this point the driver is waiting for ReadyForQuery, but the server is
> waiting for another query.

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.

            regards, tom lane

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: an efficient way of checking if the connection to a db
Next
From: Kris Jurka
Date:
Subject: Re: an efficient way of checking if the connection to a db