From: Markus Schaber <schabi@logix-tt.com>
To: me@edblackmore.net
Cc: pgsql-jdbc@postgresql.org
Subject: Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)
Date: Thu, 20 Apr 2006 09:46:26 +0200
Message-ID: <44473C52.2040105@logix-tt.com> (raw)
In-Reply-To: <44467FC6.27310.20B6E57@localhost>
References: <44467FC6.27310.20B6E57@localhost>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: schabi@logix-tt.com, me@edblackmore.net
Subject: Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)
In-Reply-To: <44473C52.2040105@logix-tt.com>
References: <44467FC6.27310.20B6E57@localhost> <44473C52.2040105@logix-tt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox