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: Tue, 18 Apr 2006 13:00:30 +0200
Message-ID: <4444C6CE.40402@logix-tt.com> (raw)
In-Reply-To: <4444D29F.1565.A24EB9@localhost>
References: <4444D29F.1565.A24EB9@localhost>
Hi, Ed,
Ed Blackmore wrote:
> I'm having trouble with a tomcat-postgres installation. Server 1 runs
> postgresql and tomcat, server 2 has an identical tomcat installation
> and application code running (except rebranding). Server 2 has errors
> about every week with 'connection reset' in logs/appname.date.log,
> futher connection attempts have a 'broken pipe' error.
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.
> The solution to get the app running again is to restart tomcat.
There was a thread here some days ago with the title "No automatic
reconnect after network error", you might have a look there.
If you're using the tomcat connection pooling, my proposed solution
there might help you:
| At least JBoss, you can use the following approach: In the Datasource
| definition, put the following:
|
| <datasources>
| <no-tx-datasource>
| <jndi-name>boo</jndi-name>
| <connection-url>jdbc:postgresql://localhost:5432/bar</connection-url>
| [ ... other attributes ... ]
| <new-connection-sql>SELECT version()</new-connection-sql>
| <check-valid-connection-sql>SELECT
| version()</check-valid-connection-sql>
| </no-tx-datasource>
| </datasources>
|
| This validates the connection before it is handed out on the
| application, and throws away invalid connections. Be aware that the SQL
| is case sensitive, we had a problem with earlier versions of OpenMDX/CRX
| that had upper case letters in the tags so they were ignored by jboss.
HTH,
Markus
--
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: <4444C6CE.40402@logix-tt.com>
References: <4444D29F.1565.A24EB9@localhost> <4444C6CE.40402@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