From russ@i2rd.com Wed Oct 5 22:17:31 2005 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 50F69DA25F for ; Wed, 5 Oct 2005 19:17:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 47835-06 for ; Wed, 5 Oct 2005 22:17:23 +0000 (GMT) Received: from ms-smtp-01.rdc-kc.rr.com (ms-smtp-01.rdc-kc.rr.com [24.94.166.115]) by svr1.postgresql.org (Postfix) with ESMTP id 892E9DA22D for ; Wed, 5 Oct 2005 19:17:23 -0300 (ADT) Received: from russ.internal.i2rd.com (rrcs-67-53-27-98.west.biz.rr.com [67.53.27.98]) by ms-smtp-01.rdc-kc.rr.com (8.12.10/8.12.7) with ESMTP id j95MH1Z7008413 for ; Wed, 5 Oct 2005 17:17:02 -0500 (CDT) From: Russ Tennant Organization: I2RD To: pgsql-jdbc@postgresql.org Subject: "org.postgresql.util.PSQLException: This ResultSet is closed" in call to rst.getString(..) Date: Wed, 5 Oct 2005 17:18:20 -0500 User-Agent: KMail/1.8.2 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4139224.qBODZSKHiP"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200510051718.20776.russ@i2rd.com> X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.137 required=5 tests=[FORGED_RCVD_HELO=0.05, HTML_40_50=0.086, HTML_MESSAGE=0.001] X-Spam-Level: X-Archive-Number: 200510/20 X-Sequence-Number: 13951 --nextPart4139224.qBODZSKHiP Content-Type: multipart/alternative; boundary="Boundary-00=_sEFRDyvT47gGZFN" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-00=_sEFRDyvT47gGZFN Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The following code throws an Exception with the postgresql jdbc driver. Thi= s code does work with the MySQL and HSQL JDBC drivers and it looks correct = to me. The call to getString(..) is what is causing the exception. It appea= rs the result set is considered closed even though ResultSet.next() returns= true in this case. Any help would be appreciated. Thanks. Info: Server Version =3D 8.0.3 JDBC Driver Version =3D 8.0 Build 312 Code that causes exception: ResultSet rstVersionColumns=3Dmeta.getVersionColumns(null, null, tableName); while (rstVersionColumns.next()) { String fieldName=3DrstColumn.getString("COLUMN_NAME"); // Exception thr= own here if (_logger.isDebugEnabled()) _logger.debug("Version field "+fieldName); // [snip] } Partial Stack Trace Caused by: org.postgresql.util.PSQLException: This ResultSet is closed. at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkClosed(AbstractJdbc2Re= sultSet.java:2457) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2Res= ultSet.java:2358) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2Resu= ltSet.java:2203) =2D-=20 Russ Tennant russ@i2rd.com --Boundary-00=_sEFRDyvT47gGZFN Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: 7bit

The following code throws an Exception with the postgresql jdbc driver. This code does work with the MySQL and HSQL JDBC drivers and it looks correct to me. The call to getString(..) is what is causing the exception. It appears the result set is considered closed even though ResultSet.next() returns true in this case. Any help would be appreciated. Thanks.

Info:

Server Version = 8.0.3

JDBC Driver Version = 8.0 Build 312

Code that causes exception:

ResultSet rstVersionColumns=meta.getVersionColumns(null, null, tableName);

while (rstVersionColumns.next())

{

String fieldName=rstColumn.getString("COLUMN_NAME"); // Exception thrown here

if (_logger.isDebugEnabled())

_logger.debug("Version field "+fieldName);

// [snip]

}

Partial Stack Trace

Caused by: org.postgresql.util.PSQLException: This ResultSet is closed.

at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkClosed(AbstractJdbc2ResultSet.java:2457)

at org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2ResultSet.java:2358)

at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:2203)

--

Russ Tennant

russ@i2rd.com

--Boundary-00=_sEFRDyvT47gGZFN-- --nextPart4139224.qBODZSKHiP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD4DBQBDRFEsF1PNCHnhVNURAnofAJUdvS2B1yn2ZBan4gHBp0sCZwXRAJ0SDTOM nrxEPuREsNlwNIYpH/msgg== =eW8p -----END PGP SIGNATURE----- --nextPart4139224.qBODZSKHiP-- From oliver@opencloud.com Wed Oct 5 22:38:06 2005 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 64ECCDA267 for ; Wed, 5 Oct 2005 19:38:06 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 27081-04 for ; Wed, 5 Oct 2005 22:38:02 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by svr1.postgresql.org (Postfix) with ESMTP id F20B3DA261 for ; Wed, 5 Oct 2005 19:38:02 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1ENHth-0007Tn-7N; Thu, 06 Oct 2005 11:38:01 +1300 Message-ID: <434455C8.5030203@opencloud.com> Date: Thu, 06 Oct 2005 11:38:00 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Russ Tennant Cc: pgsql-jdbc@postgresql.org Subject: Re: "org.postgresql.util.PSQLException: This ResultSet is References: <200510051718.20776.russ@i2rd.com> In-Reply-To: <200510051718.20776.russ@i2rd.com> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 required=5 tests=[AWL=0.008] X-Spam-Level: X-Archive-Number: 200510/21 X-Sequence-Number: 13952 Russ Tennant wrote: > It appears the result set is considered closed even though > ResultSet.next() returns true in this case. Uh, you are calling getString on a different ResultSet to the one you called next() on: > ResultSet rstVersionColumns=meta.getVersionColumns(null, null, tableName); > > while (rstVersionColumns.next()) > > { > > String fieldName=rstColumn.getString("COLUMN_NAME"); // Exception thrown > here -O From russ@i2rd.com Wed Oct 5 23:16:51 2005 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9833CDA174 for ; Wed, 5 Oct 2005 20:16:51 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 40529-10 for ; Wed, 5 Oct 2005 23:16:47 +0000 (GMT) Received: from ms-smtp-02.rdc-kc.rr.com (ms-smtp-02.rdc-kc.rr.com [24.94.166.122]) by svr1.postgresql.org (Postfix) with ESMTP id 235C8D7FE7 for ; Wed, 5 Oct 2005 20:16:48 -0300 (ADT) Received: from russ.internal.i2rd.com (rrcs-67-53-27-98.west.biz.rr.com [67.53.27.98]) by ms-smtp-02.rdc-kc.rr.com (8.12.10/8.12.7) with ESMTP id j95NGDdu014575 for ; Wed, 5 Oct 2005 18:16:13 -0500 (CDT) From: Russ Tennant Organization: I2RD To: pgsql-jdbc@postgresql.org Subject: Re: "org.postgresql.util.PSQLException: This ResultSet is closed" in call to rst.getString(..) Date: Wed, 5 Oct 2005 18:17:50 -0500 User-Agent: KMail/1.8.2 References: <200510051718.20776.russ@i2rd.com> <434455C8.5030203@opencloud.com> In-Reply-To: <434455C8.5030203@opencloud.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1299552.mdFsh70AEX"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200510051817.50474.russ@i2rd.com> X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.093 required=5 tests=[AWL=0.044, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/22 X-Sequence-Number: 13953 --nextPart1299552.mdFsh70AEX Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 05 October 2005 5:38 pm, you wrote: > Russ Tennant wrote: > > It appears the result set is considered closed even though > > ResultSet.next() returns true in this case. > > Uh, you are calling getString on a different ResultSet to the one you > > called next() on: > > ResultSet rstVersionColumns=3Dmeta.getVersionColumns(null, null, > > tableName); > > > > while (rstVersionColumns.next()) > > > > { > > > > String fieldName=3DrstColumn.getString("COLUMN_NAME"); // Exception > > thrown here > > -O Ahah! :) Sorry for the false alarm. =2D-=20 Russ Tennant russ@i2rd.com --nextPart1299552.mdFsh70AEX Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBDRF8eF1PNCHnhVNURApQmAJ97aNL+6Uhc1OEe6qQhkjyOIxGYFgCfWKuM lwlx/B5WpL/z4hXAFhESWEM= =Rzjf -----END PGP SIGNATURE----- --nextPart1299552.mdFsh70AEX-- From pg@fastcrypt.com Wed Oct 5 23:20:41 2005 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0CAE5DA261 for ; Wed, 5 Oct 2005 20:20:41 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59114-01 for ; Wed, 5 Oct 2005 23:20:33 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 14177DA231 for ; Wed, 5 Oct 2005 20:20:34 -0300 (ADT) Received: (qmail 32490 invoked from network); 5 Oct 2005 23:20:36 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 5 Oct 2005 23:20:36 -0000 In-Reply-To: <434455C8.5030203@opencloud.com> References: <200510051718.20776.russ@i2rd.com> <434455C8.5030203@opencloud.com> Mime-Version: 1.0 (Apple Message framework v734) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <076EFC36-4950-4E7D-9AC6-540B999F5449@fastcrypt.com> Cc: Russ Tennant , pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: "org.postgresql.util.PSQLException: This ResultSet is Date: Wed, 5 Oct 2005 19:20:31 -0400 To: Oliver Jowett X-Mailer: Apple Mail (2.734) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.02 required=5 tests=[AWL=0.020] X-Spam-Level: X-Archive-Number: 200510/23 X-Sequence-Number: 13954 The more interesting thing is what do HSQL and MySql return here ;) Dave On 5-Oct-05, at 6:38 PM, Oliver Jowett wrote: > Russ Tennant wrote: > >> It appears the result set is considered closed even though >> ResultSet.next() returns true in this case. >> > > Uh, you are calling getString on a different ResultSet to the one you > called next() on: > > >> ResultSet rstVersionColumns=meta.getVersionColumns(null, null, >> tableName); >> >> while (rstVersionColumns.next()) >> >> { >> >> String fieldName=rstColumn.getString("COLUMN_NAME"); // Exception >> thrown >> here >> > > -O > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: explain analyze is your friend > >