Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: me(at)edblackmore(dot)net
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)
Date: 2006-04-20 07:46:26
Message-ID: 44473C52.2040105@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi, Ed,

Ed Blackmore wrote:

> I wasn't able to nicely induce the error through our firewall or
> taking connections down, but restarting postgresql did lead to a
> broken pipe error. The above fix didn't help in this scenerio.
>
> Reading other posts it seems that the jdbc driver is not expected to
> reopen connections, therefore it doesn't seem using a newer version
> will help. Given that our tomcat app doesn't reconnect to a
> postgresql db after it (the database) has been restarted, is it
> correct I need to work with the app developer as to how we use the
> connection pool, or are there configuration changes that can help?

Yes, that's true.

My workaround protects against a pool handing out broken connections[1],
but the Application still must get a fresh connection ittself.

Most JSP pages and Servlets I've seen get such a connection on every
incoming request, most Servlets I've written refresh their connection
when an appropriate SQL exception happens.

I think that this is the way your app has to be modified - refresh the
SQL connection in case of an Exception.

HTH,
Markus

[1] Before java 1.6, the pool has no (easy and portable) way to tell
whether a connection is still valid.

--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Michael Barker 2006-04-20 07:48:10 Re: [PATCH] Support for ping method.
Previous Message Oliver Jowett 2006-04-20 01:08:32 Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)