Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id EBAEC634EFB; Tue, 20 Apr 2010 13:28:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 47054-01-8; Tue, 20 Apr 2010 16:28:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id ED63363693D; Tue, 20 Apr 2010 13:07:50 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 20ED228436; Tue, 20 Apr 2010 12:07:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=cLMquQm/LKhjF3uX84w0ZlpvaoU=; b=GYGSf4 E4jGzcKTsgFBTs/ptQ6Gy/SPVONQh9S5xf5ngP5VUs5xP7aG2An1t0+WBsu4qLsv qiYzvz1b4k0IZHyety0vz+Jhh4ffqBkIMIOhxTY/8C4y+46sXeNaqCwKLHj/aghk v6y+mtpTuUzX9hp5UJz5cxQPluAimUHdrSzc8= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 08C5728432; Tue, 20 Apr 2010 12:07:49 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id ACA72A424; Tue, 20 Apr 2010 12:07:48 -0400 (EDT) Date: Tue, 20 Apr 2010 12:07:48 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Dave Crooke cc: Scott Carey , pgsql-performance , pgsql-jdbc@postgresql.org Subject: Re: SOLVED ... Re: Getting rid of a cursor from JDBC .... Re: [PERFORM] Re: HELP: How to tame the 8.3.x JDBC driver with a biq guery result set In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.166 tagged_above=-10 required=5 tests=AWL=-0.256, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/33 X-Sequence-Number: 20444 On Mon, 19 Apr 2010, Dave Crooke wrote: > Statement.close() appears to get the job done (in my envrionment, PG's > driver never sees a Connection.close() because of DBCP). > > I'd consider the fact that ResultSet.close() does not release the implicit > cursor to be something of a bug, but it may well have been fixed already. PG doesn't release the locks acquired by the query until transaction end. So closing a cursor will release some backend memory, but it won't release the locks. The way the driver implements ResultSet.close() is to put the close message into a queue so that the next time a message is sent to the backend we'll also send the cursor close message. This avoids an extra network roundtrip for the close action. In any case Statement.close isn't helping you here either. It's really Connection.commit/rollback that's releasing the locks. Kris Jurka