Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kris Jurka <books(at)ejurka(dot)com>
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 22:54:21
Message-ID: 17890.1134687261@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-jdbc
Kris Jurka <books(at)ejurka(dot)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

In response to

Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2005-12-15 23:36:53
Subject: Re: an efficient way of checking if the connection to a db
Previous:From: Kris JurkaDate: 2005-12-15 22:41:23
Subject: Re: an efficient way of checking if the connection to a db

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group