X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 78C9AD1C9EF for ; Mon, 22 Sep 2003 16:36:55 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 62150-01 for ; Mon, 22 Sep 2003 13:36:45 -0300 (ADT) Received: from mail.xythos.com (unknown [206.14.210.116]) by svr1.postgresql.org (Postfix) with ESMTP id 4C216D1C9EB for ; Mon, 22 Sep 2003 13:36:44 -0300 (ADT) Received: from ravms by mail.xythos.com with mail-ok (Exim 3.36 #3) id 1A1Tg3-0003RR-00; Mon, 22 Sep 2003 16:36:43 +0000 Received: from [192.168.1.182] (helo=xythos.com) by mail.xythos.com with asmtp (Exim 3.36 #3) id 1A1Tg3-0003RG-00; Mon, 22 Sep 2003 16:36:43 +0000 Message-ID: <3F6F1964.50004@xythos.com> Date: Mon, 22 Sep 2003 08:46:44 -0700 From: Barry Lind User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Phil.Hourihane@meridianp2p.com Cc: pgsql-jdbc@postgresql.org Subject: Re: java.net.SocketException: Broken pipe References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Envelope-To: Phil.Hourihane@meridianp2p.com, pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/226 X-Sequence-Number: 8367 Phil, A possible cause is a firewall or some other device between the client and the server that drops connections after a certain time. (Most firewall don't allow you to keep connections open indefinitely). thanks, --Barry Phil.Hourihane@meridianp2p.com wrote: > Hello, World. > > I have an intermittent problem that I am having trouble with, using > postgresql > 7.3.4. It manifests itself as a SocketException... > > java.net.SocketException: Broken pipe > at java.net.SocketOutputStream.socketWrite0(Native Method) > at > java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) > at java.net.SocketOutputStream.write(SocketOutputStream.java:136) > at > java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69) > at > java.io.BufferedOutputStream.flush(BufferedOutputStream.java:127) > at org.postgresql.PG_Stream.flush(PG_Stream.java:352) > at > org.postgresql.core.QueryExecutor.sendQuery(QueryExecutor.java:159) > at > org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:70) > ...etc... > > ... but it doesn't seem to correspond to the mails on this list that > mention > this trace. The previous mails warn that this can happen if an earlier > statement > includes a null character (char 0). I tried to reproduce the problem that > way but instead I was prevented by... > > java.lang.IllegalArgumentException: \0 not allowed > at > org.postgresql.jdbc1.AbstractJdbc1Statement.escapeString(AbstractJdbc1Statement.java:955) > at > org.postgresql.jdbc1.AbstractJdbc1Statement.setString(AbstractJdbc1Statement.java:917) > at > org.postgresql.jdbc1.AbstractJdbc1Statement.setString(AbstractJdbc1Statement.java:900) > ...etc... > > Now, the problem seems to occur only intermittently, and will 'repair' > itself > with no action on my part. It does however, seem to occur in clumps - it > will > fail a few times in a short space of time before working again. > > I have created a statement at boot time for this purpose (it is a > statement > that gets used a lot, so I prefer to cache it), rather than create a new > statement for each invocation. Some posts on the mailing list mention this > as a problem (the backend shutting down the connection), but I have no > idea > how to control this behaviour. > > I don't seen to be able to reproduce this behaviour on demand; I have seen > it in logs of a system that is running long-term, not just a development > box > that is working for a little bit at a time. > > It doesn't seem to be related to heavy loads on the system either - the > load > has been pretty light when it occurred. > > Has anybody else encountered this problem or had any success in dealing > with it? > > PHiL