Fastest way to check aliveness of connection

From: Daniel Migowski <dmigowski(at)ikoffice(dot)de>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Fastest way to check aliveness of connection
Date: 2008-02-26 13:36:56
Message-ID: 47C415F8.2020406@ikoffice.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello,

I want to implement a c3p0 ConnectionTester and now need a fast way to
check for the alivelyness of a Connection. Currently I issue a "select
1" to the database and if I don't get an exception I assume the
connection is still alive.

Is there a faster way? How can I check if the underlying socket is still
alive without doing a JDBC request? This has to work only with
PostgreSQL JDBC, so I can cast to any postgres interface available.

With best regards,
Daniel Migowski

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2008-02-26 22:20:24 Re: Fastest way to check aliveness of connection
Previous Message Andrea Aime 2008-02-26 13:36:07 Bug while retrieving money data type from db