Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id BB60E6333EC; Tue, 20 Apr 2010 13:23:47 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 97098-01-3; Tue, 20 Apr 2010 16:23:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mail.postgresql.org (Postfix) with ESMTP id EE70B633B55; Tue, 20 Apr 2010 12:47:26 -0300 (ADT) Received: by bwz8 with SMTP id 8so5687739bwz.3 for ; Tue, 20 Apr 2010 08:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=NUXIXXNlBx2myo+yCWxHfKKokC65719QC0RuMIBVlHI=; b=ChXiInOgEILV/OWvAmiOQnanayPB3LBP0Nr4Kx2waL6IZ0imq4DKjRjWcm8iS6t87e uPSgY1DHTewsnLNAJtILtQKndddNRe7Z7LjUhVAUnVS3ck2S18juo9ci0J3w2wMEyX11 MHUI/YMwNnwnA4jNU8EXEUliwwyYujGH6kxYQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=DzNyb6ahrjzFBjCfuuivRMCZT172cGQ0gNAigXV0tcl/TQNckUL25vUA7ggxpvSPDO nz4tdiuls3WO+2KT2vd6+NJBfMyf8Z3T68g8ZwXSHe5+L+3FCz+CcE6z4eV/mQ9a4FAP q1oCcbB2nkNrY6Zsw4Eke6MVHL6r/hstWKqhg= MIME-Version: 1.0 Received: by 10.204.66.8 with HTTP; Tue, 20 Apr 2010 08:47:25 -0700 (PDT) In-Reply-To: <4BCD73AF0200002500030BC2@gw.wicourts.gov> References: <4BCD73AF0200002500030BC2@gw.wicourts.gov> Date: Tue, 20 Apr 2010 10:47:25 -0500 Received: by 10.204.131.198 with SMTP id y6mr4287862bks.4.1271778445333; Tue, 20 Apr 2010 08:47:25 -0700 (PDT) Message-ID: 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 From: Dave Crooke To: Kevin Grittner Cc: Scott Carey , pgsql-jdbc@postgresql.org, pgsql-performance Content-Type: multipart/alternative; boundary=0015174780c07794e50484acfee7 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201004/32 X-Sequence-Number: 20443 --0015174780c07794e50484acfee7 Content-Type: text/plain; charset=UTF-8 AFAICT from the Java end, ResultSet.close() is supposed to be final. There is no way I know of in JDBC to get a handle back to the cursor on the server side once you have made this call - in fact, its sole purpose is to inform the server in a timely fashion that this cursor is no longer required, since the ResultSet itself is a Java object and thus subject to garbage collection and finalizer hooks. At a pragmatic level, the PGSQL JDBC driver has a lot of odd behaviours which, while they may or may not be in strict compliance with the letter of the standard, are very different from any other mainstream database that I have accessed from Java .... what I'd consider as normative behaviour, using regular JDBC calls without the need to jump through all these weird hoops, is exhibited by all of the following: Oracle, SQL Server, DB2, MySQL, Apache Derby and JET (MS-Access file-based back end, the .mdb format) In practce, this places PGSQL as the odd one out, which is a bit of a turn-off to expereinced Java people who are PG newbies for what is otherwise an excellent database. At my current post, I came into a shop that had PG as the only real database, so I have learned to love it, and de-supported Derby and the other toy back ends we used to use. And to be fair, from a back end perspective, PG is better than MySQL in terms of manageability .... I am running 250GB databases on small systems with no issues. At my previous shop, we built a couple of database-backed apps from scratch, and despite a desire to use PG due to there being more certainty over its future licensing (it was just after Sun had bought MySQL AG), I ended up switching from PG to MySQL 5.0.47 (last open source version) because of the difficulties I was having with the PG driver. I consider part of the acme of great FOSS is to make it easy to use for newbies and thus attract a larger user base, but that is just my $0.02 worth. Cheers Dave On Tue, Apr 20, 2010 at 9:28 AM, Kevin Grittner wrote: > Dave Crooke wrote: > > > I'd consider the fact that ResultSet.close() does not release the > > implicit cursor to be something of a bug > > What's your reasoning on that? The definitions of cursors in the > spec, if memory serves, allow a cursor to be closed and re-opened; > why would this be treated differently? > > -Kevin > --0015174780c07794e50484acfee7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable AFAICT from the Java end, ResultSet.close() is supposed to be final. There = is no way I know of in JDBC to get a handle back to the cursor on the serve= r side once you have made this call - in fact, its sole purpose is to infor= m the server in a timely fashion that this cursor is no longer required, si= nce the ResultSet itself is a Java object and thus subject to garbage colle= ction and finalizer hooks.

At a pragmatic level, the PGSQL JDBC driver has a lot of odd behaviours= which, while they may or may not be in strict compliance with the letter o= f the standard, are very different from any other mainstream database that = I have accessed from Java .... what I'd consider as normative behaviour= , using regular JDBC calls without the need to jump through all these weird= hoops, is exhibited by all of the following: Oracle, SQL Server, DB2, MySQ= L, Apache Derby and JET (MS-Access file-based back end, the .mdb format)
In practce, this places PGSQL as the odd one out, which is a bit of a t= urn-off to expereinced Java people who are PG newbies for what is otherwise= an excellent database.

At my current post, I came into a shop that= had PG as the only real database, so I have learned to love it, and de-sup= ported Derby and the other toy back ends we used to use. And to be fair, fr= om a back end perspective, PG is better than MySQL in terms of manageabilit= y .... I am running 250GB databases on small systems with no issues.

At my previous shop, we built a couple of database-backed apps from scr= atch, and despite a desire to use PG due to there being more certainty over= its future licensing (it was just after Sun had bought MySQL AG), I ended = up switching from PG to MySQL 5.0.47 (last open source version) because of = the difficulties I was having with the PG driver.

I consider part of the acme of great FOSS is to make it easy to use for= newbies and thus attract a larger user base, but that is just my $0.02 wor= th.

Cheers
Dave

On Tue, Apr 20,= 2010 at 9:28 AM, Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote= :
Dave Crooke <dcrooke@gmail.com= > wrote:

> I'd consider the fact that ResultSet.close= () does not release the
> implicit cursor to be something of a bug

What's your reasoning on that? =C2=A0The definitions of cursors i= n the
spec, if memory serves, allow a cursor to be closed and re-opened;
why would this be treated differently?

-Kevin

--0015174780c07794e50484acfee7--