Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 607481997F5A for ; Tue, 12 Jun 2012 04:12:22 -0300 (ADT) Received: from mail-pz0-f46.google.com ([209.85.210.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SeLH2-0004ri-Dg for pgsql-jdbc@postgresql.org; Tue, 12 Jun 2012 07:12:21 +0000 Received: by dady13 with SMTP id y13so6472779dad.19 for ; Tue, 12 Jun 2012 00:12:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=mD3pk+SNfQJ0+byS/2rNtGPV5HDwdxGlfWP4j11tnxA=; b=UmCHxiL2uGnEt3kVrAQSGNjrxztVRorekg1+D9sYzvoaFEtDKsaTRBDukzmvgj2uJt kvtKW274mLDPor2U8spA7x8MNrmW/CgNdXPo4+zHylGfIMjX87SYFb+1ZICLP1jCknj2 J52/UfyTB89BXF4bkKc0tD8w5ePsr2551gI44V0SuVrhM3zeNY5NW1wA3DcvH3Fd/qUj e/kGp+1Nspocpqvi0x6TulcHey/Z6gwfyPwIHXOI0qnb3d8OyXd+ZBCJIDHDE7kDk1Lx g8ZyBvZLQhgr1bSh+OvrpoDVFDTkcZx8Hpxfqj5JrU3CB3EK8JZk8N3PgO6Q5N5nLwXt 2ukg== Received: by 10.68.204.2 with SMTP id ku2mr35513333pbc.55.1339485126708; Tue, 12 Jun 2012 00:12:06 -0700 (PDT) Received: from ayaki.localdomain ([124.150.37.180]) by mx.google.com with ESMTPS id rj4sm1062752pbc.30.2012.06.12.00.12.04 (version=SSLv3 cipher=OTHER); Tue, 12 Jun 2012 00:12:05 -0700 (PDT) Message-ID: <4FD6EBC1.1000006@ringerc.id.au> Date: Tue, 12 Jun 2012 15:12:01 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Mike Charnoky CC: pgsql-jdbc@postgresql.org Subject: Re: Hung JDBC connections References: <4FD20A3F.70602@nextbus.com> <4FD416D9.8020808@ringerc.id.au> <4FD60870.4040304@nextbus.com> In-Reply-To: <4FD60870.4040304@nextbus.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkNscfaXVwAQHtIoPqNd4Ftlxj9Z/ZI5SvpkyUrt+Th/s2bOBMXWUKNAC/wsK9JflbK/cYc X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/62 X-Sequence-Number: 23056 On 06/11/2012 11:02 PM, Mike Charnoky wrote: > > On 06/09/2012 11:39 PM, Craig Ringer wrote: >> >> Of course, It's not very friendly for the JDBC driver to wait >> indefinitely without periodically checking and seeing if the >> connection was progressing, so I'm glad to see that's changed in 9.1. >> > I took a look at the 9.1 JDBC driver source code, very enlightening. I > see that Statement.setQueryTimeout() doesn't actually do anything! The > method sets a member variable which is never accessed locally or by > any subclasses or via getQueryTimeout(). There is even the following > comment in AbstractJdbc2Statement: > /** Timeout (in seconds) for a query (not used) */ > protected int timeout = 0; > > I see that ConnectionFactoryImpl does allow the underlying Socket's > so_timeout and so_keepalive options to be set using the connection > parameters string: > http://jdbc.postgresql.org/documentation/91/connect.html > (socketTimeout and tcpKeepAlive). Didn't realize these options > existed, I will definitely be taking advantage of these. > > However, I see these options were available as far back as 8.4. What > exactly are these driver changes in 9.1 that you mentioned??? Sorry, as Dave points out, 9.2. -- Craig Ringer