Re: Detecting 'socket errors' - closing the Connection object - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Detecting 'socket errors' - closing the Connection object
Date
Msg-id 20030723001424.GE31669@opencloud.com
Whole thread Raw
In response to Re: Detecting 'socket errors' - closing the Connection object  ("David Wall" <d.wall@computer.org>)
List 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

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Patch applied for SQL Injection vulnerability for setObject(int,Object,int)
Next
From: "David Wall"
Date:
Subject: Re: Detecting 'socket errors' - closing the Connection object