From: Assad Jarrahian <jarraa@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: an efficient way of checking if the connection to a db is actually open
Date: Thu, 15 Dec 2005 13:47:03 -0700
Message-ID: <4bd3e1480512151247u50479082vd08b9a1563d54604@mail.gmail.com> (raw)
Hi All,
Trying to check if a connection is actually open every time I perform an
operation (if not, I want to reopen it and perform that operation).
isClosed()
*<http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Connection.html#isClosed%28%29;
* is no good, as in, it only guarantees true if close() was actually called
on it.
The documentation says, the only real way is to actually call an sql
statement on it. That seems inefficient. Is there any other way that is
recommended?
Much thanks in advance.
-assad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: jarraa@gmail.com
Subject: Re: an efficient way of checking if the connection to a db is actually open
In-Reply-To: <4bd3e1480512151247u50479082vd08b9a1563d54604@mail.gmail.com>
References: <4bd3e1480512151247u50479082vd08b9a1563d54604@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox