pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ed Blackmore <me@edblackmore.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)
Date: Wed, 19 Apr 2006 18:21:58 +0100
Message-ID: <44467FC6.27310.20B6E57@localhost> (raw)

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




view thread (5+ messages)  latest in thread

Message-ID: <44467FC6.27310.20B6E57@localhost>
Permalink:  ../44467FC6.27310.20B6E57@localhost/
Also on:    postgresql.org/message-id/44467FC6.27310.20B6E57@localhost

 · 

reply

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: me@edblackmore.net
  Subject: Re: connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)
  In-Reply-To: <44467FC6.27310.20B6E57@localhost>
  References: <44467FC6.27310.20B6E57@localhost>

* 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