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 648483A494C for ; Fri, 19 Nov 2004 04:35:12 +0000 (GMT) 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 60195-01 for ; Fri, 19 Nov 2004 04:35:03 +0000 (GMT) Received: from hotmail.com (bay24-f2.bay24.hotmail.com [64.4.18.52]) by svr1.postgresql.org (Postfix) with ESMTP id 17FF23A3D4E for ; Fri, 19 Nov 2004 04:35:02 +0000 (GMT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 18 Nov 2004 20:35:01 -0800 Message-ID: Received: from 129.128.194.38 by by24fd.bay24.hotmail.msn.com with HTTP; Fri, 19 Nov 2004 04:34:51 GMT X-Originating-IP: [129.128.194.38] X-Originating-Email: [xingzc_he@hotmail.com] X-Sender: xingzc_he@hotmail.com In-Reply-To: <419D571B.7080609@opencloud.com> From: "jessica xingzc_he" To: pgsql-jdbc@postgresql.org Subject: Re: deleteRow or updateRow after insertRow Date: Thu, 18 Nov 2004 21:34:51 -0700 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 19 Nov 2004 04:35:01.0219 (UTC) FILETIME=[21DD7330:01C4CDF1] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.8 tagged_above=0.0 required=5.0 tests=MSGID_FROM_MTA_HEADER X-Spam-Level: X-Archive-Number: 200411/150 X-Sequence-Number: 11572 it seems that moveToCurrentRow(), first(), last(), etc. work after insertRow(). But using absolute() to navigate some row else does not. >From: Oliver Jowett >To: jessica xingzc_he >CC: pgsql-jdbc@postgresql.org >Subject: Re: [JDBC] deleteRow or updateRow after insertRow >Date: Fri, 19 Nov 2004 15:14:51 +1300 > >jessica xingzc_he wrote: > >>I do first: >>ResultSet.moveToInsertRow(); >>ResultSet.update...(1, ...); >>.... >>rs.insertRow(); // a new row inserted into table >> >>but after that, I may move to some other row, say using >>Result.absolute(..) or so, and then >>1. update >>ResultSet.update...(1, ...); >>... >>ResultSet.updateRow(); // it does not update the corresponding row in the >>table, but also no >> exception thrown. >> >>2. delete >>ResultSet.deleteRow(); // throws exception: Can not call deleteRow() when >>on insert row. > >Both cases sound like the driver thinks you are on the insert row. Are you >sure that you are navigating away from the insert row after calling >insertRow() and are not returning to it for some reason? > >Does the problem still occur if you use the latest development driver? If >so, do you have a testcase that demonstrates it? > >It looks like updateRow when on the insert row is handle incorrectly :we >should throw an exception according to the javadoc, but we silently do >nothing. I will fix this in the development driver shortly. It won't help >your problem, though.. > >-O