X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D852452C24 for ; Wed, 27 Jul 2005 01:56:47 -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 28297-10 for ; Wed, 27 Jul 2005 04:56:39 +0000 (GMT) Received: from workhorse.newkinetics.com (usgw.newkinetics.com [216.27.182.2]) by svr1.postgresql.org (Postfix) with ESMTP id BE66452C48 for ; Wed, 27 Jul 2005 01:56:38 -0300 (ADT) Received: from workhorse.newkinetics.com (localhost [127.0.0.1]) by workhorse.newkinetics.com (8.12.10/8.12.2/SuSE Linux 0.6) with ESMTP id j6R50PVA020147 for ; Tue, 26 Jul 2005 22:00:25 -0700 Received: (from carterl@localhost) by workhorse.newkinetics.com (8.12.10/8.12.10/Submit) id j6R50PZi020146; Tue, 26 Jul 2005 22:00:25 -0700 Date: Tue, 26 Jul 2005 22:00:25 -0700 X-Authentication-Warning: workhorse.newkinetics.com: carterl set sender to carterl@newkinetics.com using -f From: "Les Carter" Subject: unusual ResultSet.next() behaviour To: pgsql-jdbc@postgresql.org Cc: X-Originating-IP: 10.1.1.220 X-Mailer: Usermin 1.150 Message-Id: <1122440425.20140@workhorse.newkinetics.com> MIME-Version: 1.0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.395 tagged_above=0 required=5 tests=HTML_00_10, HTML_MESSAGE, HTML_MIME_NO_HTML_TAG, MIME_HTML_ONLY X-Spam-Level: * Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Archive-Number: 200507/363 X-Sequence-Number: 13511 This is a multi-part message in MIME format. --bound1122440425 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Consider the following code snippet where rs is a ResultSet object obtained from a previous query:

=A0=A0=A0 for(int count=3D0; count!=3DsomeValue; count++)
=A0=A0=A0 {
=A0=A0=A0=A0=A0=A0=A0 if(!rs.next()) throw SomeException();
=A0=A0=A0 }
=A0=A0=A0 rs.next();

Pretty simple, just cycle through someValue number of records and then get the next record after that.=A0 For some reason, say if the query has 20 rows that will be returned, and I set someValue to be 5 for arguments sake, it will go through the for loop with no problems, but when it comes out of the for loop and tries to the next rs.next() operation it always returns false.=A0 I can increase someValue to 10 and it will still loop without a problem, but it will always return false for that rs.next() operation following the for loop.

I can't see any rational reason for this.=A0 I'm using PostgreSQL 8.0 and the JDBC 3 drivers on Win XP with JDK 1.42_06.=A0 The ResultS! et is a proxy object gained from a JBoss4.0 supplied connection pool.

Can anyone offer any explanation, or repeat the simple steps to confirm I'm not loosing my sanity?

Cheers,

L
--bound1122440425--