X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 4FB01D1B26E for ; Sun, 30 May 2004 16:20:03 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 87996-08 for ; Sun, 30 May 2004 16:20:03 -0300 (ADT) Received: from smtp2.echo-on.net (smtp2.echo-on.net [204.138.111.139]) by svr1.postgresql.org (Postfix) with ESMTP id 8BBD9D1B1DC for ; Sun, 30 May 2004 16:20:00 -0300 (ADT) Received: from localhost (webmail1.eol.ca [204.138.111.154]) by smtp2.echo-on.net (Postfix) with ESMTP id 152B91362A; Sun, 30 May 2004 15:31:44 -0400 (EDT) Received: from ppp-RAS3-2-69.dialup.eol.ca (ppp-RAS3-2-69.dialup.eol.ca [64.56.245.69]) by webmail.eol.ca (IMP) with HTTP for ; Sun, 30 May 2004 15:26:25 -0400 Message-ID: <1085945185.40ba3561e442e@webmail.eol.ca> Date: Sun, 30 May 2004 15:26:25 -0400 From: shadowd@connection.com To: Warren Little Cc: pgsql-jdbc@postgresql.org Subject: Re: application handing on send References: <1085758206.5841.21.camel@localhost.localdomain> <1085764600.5841.35.camel@localhost.localdomain> In-Reply-To: <1085764600.5841.35.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.2 X-Originating-IP: 64.56.245.69 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200405/186 X-Sequence-Number: 10196 Socket.setSoTimeout(int timeout) will do this on most platforms. Once set, any blocking read will throw a java.net.SocketTimeoutException (subclass of java.io.IOException) when the read times out. Like I said, this doesn't work on *ALL* platforms, but I think Windoze and Linux are supported. > Question to my own question: > Is there even such a mechanism in the Socket class to do a timeout on a > write? > > On Fri, 2004-05-28 at 09:30, Warren Little wrote: > > My tomcat application occasionally hangs trying push data to the > > postgres backend. When I view the connection to postgres with netstat I > > see data sitting in the sendQ on the socket. > > There is a firewall (cisco pix) between the tomcat server and the > > database server. > > I was wondering if there is some way to set the timeout on the driver as > > to force a IO exception and terminate the jdbc request. > > > -- > Warren Little > Senior Vice President > Secondary Marketing > Security Lending Wholesale, LC > www.securitylending.com > Tel: 866-369-7763 > Fax: 866-849-8079 > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend >