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 CEBF4D1B588 for ; Tue, 23 Sep 2003 16:39:17 +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 18274-03 for ; Tue, 23 Sep 2003 13:38:46 -0300 (ADT) Received: from mail.xythos.com (unknown [206.14.210.116]) by svr1.postgresql.org (Postfix) with ESMTP id D9D33D1B528 for ; Tue, 23 Sep 2003 13:38:45 -0300 (ADT) Received: from ravms by mail.xythos.com with mail-ok (Exim 3.36 #3) id 1A1qBZ-0000OK-00; Tue, 23 Sep 2003 16:38:45 +0000 Received: from [192.168.1.182] (helo=xythos.com) by mail.xythos.com with asmtp (Exim 3.36 #3) id 1A1qBW-0000Nx-00; Tue, 23 Sep 2003 16:38:42 +0000 Message-ID: <3F706F79.4020202@xythos.com> Date: Tue, 23 Sep 2003 09:06:17 -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/234 X-Sequence-Number: 8375 Phil, Phil.Hourihane@meridianp2p.com wrote: >>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 > > > Thanks, Barrry, for your reply. > > Unfortunately, I don't think this is my problem.There is no firewall in > place which would prevent a connection from lasting for any > length of time. In fact, the statement that I am caching is built > around a connection pool, so that the statement should not > actually be using the same connection each time it is run at all. > Here is your problem. A statement object is owned by a connection. You cannot cache statement objects across different connections. What will actually happen is if you later use the statement, it will still be using the connection that created it, even if you have returned that connection back to the pool. What I suspect is happening is that your connection pool is occasionally closing connections and it just so happens that the connection closed is the one used by your cached statement. If you want to cache a statement like this, you will also need to cache the connection that goes with that statement. thanks, --Barry