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-18 11:00:30
Message-ID: 4444C6CE.40402@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Achilleus Mantzios 2006-04-18 11:26:14 Re: [JDBC] Thoughts on a Isolation/Security problem.
Previous Message Ed Blackmore 2006-04-18 10:50:55 connection reset error, followed by broken pipe (pg74.213.jdbc3.jar)