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

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: David Wall <d(dot)wall(at)computer(dot)org>
Cc: pgsql-jdbc-list <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Detecting 'socket errors' - closing the Connection object
Date: 2003-07-23 00:14:24
Message-ID: 20030723001424.GE31669@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, Jul 22, 2003 at 10:15:25AM -0700, David Wall wrote:
> > > > Retrieves whether this Connection object has been closed. A connection
> is
> > > > closed if the method close has been called on it or if certain fatal
> > > > errors have occurred.
>
> Precisely. This makes PERFECT sense to me. It's those fatal errors that
> should allow us to detect something has gone wrong and therefore should not
> be retried. If the JDBC Connection gets an I/O exception, it could easily
> close itself. I suspect I could add that code to the Postgresql JDBC
> library myself quite easily. The unfortunate situation, though, is that
> other JDBC libraries may or may not do it, so therefore it's an unreliable
> bit of code, and Dmitry's hack comes back into play as perhaps the only
> reliable solution with the current state of affairs among JDBC
> implementations. I know for sure that Oracle does not close itself.

Have you looked at the ConnectionEventListener approach? I know that it's
not currently implemented in postgresql, but it should be easy enough to
add, and in theory this is the standard way of doing it.

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Wall 2003-07-23 00:25:36 Re: Detecting 'socket errors' - closing the Connection object
Previous Message Oliver Jowett 2003-07-23 00:11:06 Re: Patch applied for SQL Injection vulnerability for setObject(int, Object, int)