Re: Detecting 'socket errors' - closing the Connection object

From: Fernando Nasser <fnasser(at)redhat(dot)com>
To: David Wall <d(dot)wall(at)computer(dot)org>
Cc: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Detecting 'socket errors' - closing the Connection object
Date: 2003-07-22 17:08:09
Message-ID: 3F1D6F79.9040402@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

David Wall wrote:
>
> Again, I'm okay with closing it myself if there were an obvious way to
> detect that a given SQLException was in fact related to an unrecoverable I/O
> error. It's just that simple.
>

When we get the SQLSTATE patch in you'll be able to do:

if ((e.getSQLState() != null) && (e.getSQLState().equals("08S01")))
throw new ExplainException("Communication link error: " + e.getMessage());

--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Wall 2003-07-22 17:15:25 Re: Detecting 'socket errors' - closing the Connection object
Previous Message David Wall 2003-07-22 17:04:25 Re: Detecting 'socket errors' - closing the Connection object