Re: Handling network errors during initial connection and ongoing use

From: "Michael Schmidt" <michaelmschmidt(at)msn(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>, "Adrian Custer" <acuster(at)gmail(dot)com>
Subject: Re: Handling network errors during initial connection and ongoing use
Date: 2007-04-17 20:11:39
Message-ID: BAY114-DAV157B42034B2AAFAF1DCD59A3510@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I addressed several of these issues in Komo, although I don't know how "elegant" my efforts were. You can download the source code from the Komo project at pgFoundry, and look particularly at the ConnectionManager class. If you upgrade the code, I would definitely be interested in hearing from you back channel (MichaelMSchmidt(at)msn(dot)com<mailto:MichaelMSchmidt(at)msn(dot)com>).

Best of luck!
Michael Schmidt
----- Original Message -----
From: Adrian Custer<mailto:acuster(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org<mailto:pgsql-jdbc(at)postgresql(dot)org>
Sent: Tuesday, April 17, 2007 8:59 AM
Subject: [JDBC] Handling network errors during initial connection and ongoing use

Hey all,

I'm working on fixing an application that uses jdbc so it will provide
users with a better understanding of what is wrong when things go wrong.
However, I cannot find any information on elegant ways to handle the
'unreliable' part of tcp/ip.

Is there some common strategy to handle network errors during setup or
use of jdbc?

Specifically, I imagine all java applications using jdbc would have to
handle:
during initial connection
no network
no dns
host name unknown
no answer on port
answer on port not postgresql
bad authentication
(wrong username/password if these are distinct)
user doesn't have permissions to read database

during ongoing use
network failure
server failure

Could anyone point me toward documents/topic which cover these issues?

Thank you,
adrian custer

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2007-04-18 09:02:18 new releases available
Previous Message Adrian Custer 2007-04-17 14:59:02 Handling network errors during initial connection and ongoing use