Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar) - Mailing list pgsql-jdbc

From Ed Blackmore
Subject Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)
Date
Msg-id 44467FC6.27310.20B6E57@localhost
Whole thread Raw
In response to connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)  ("Ed Blackmore" <me@edblackmore.net>)
Responses Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)  (Oliver Jowett <oliver@opencloud.com>)
Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)  (Markus Schaber <schabi@logix-tt.com>)
List pgsql-jdbc
Hi Markus,

Thankyou for your assistance.

> So it seems that the network connection breaks from time to time
> Independently from making your application more robust, you might want
> to put some research into that.

Yes, I put a minutely ping script in place, which wasn't able to
detect a failure at a time when the connection was lost. The servers
are dedicated server (installed and hosted by another company), so
I've been trying to detect any outages to report to them.

> If you're using the tomcat connection pooling, my proposed solution
> there might help you

Thanks, I tried the following settings based on your idea looking for
similar tomcat settings on google:

In webapps/ourapp/META-INF/context.ml, adding:
    <parameter>
      <name>testOnBorrow</name>
      <value>true</value>
    </parameter>
    <parameter>
      <name>testOnReturn</name>
      <value>true</value>
    </parameter>
    <parameter>
      <name>validationQuery</name>
      <value>select version()</value>
    </parameter>

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?

Regards,
Ed


pgsql-jdbc by date:

Previous
From: "Guy Rouillier"
Date:
Subject: Re: stored function, multiple queries, best practices
Next
From: Oliver Jowett
Date:
Subject: Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)