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 9619D14B281B for ; Thu, 12 Aug 2004 02:41:37 -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 71581-01 for ; Thu, 12 Aug 2004 05:41:29 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 9513814B281C for ; Thu, 12 Aug 2004 02:41:24 -0300 (ADT) Received: from flood.opencloud.co.nz ([192.168.0.31]) by yass.opencloud.co.nz with esmtp (Exim 3.35 #1 (Debian)) id 1Bv8L2-0001EZ-00; Thu, 12 Aug 2004 17:41:20 +1200 Message-ID: <411B02FE.6060600@opencloud.com> Date: Thu, 12 Aug 2004 17:41:18 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Elie Nacache Cc: pgsql-jdbc@postgresql.org Subject: Re: [GENERAL] Resultset problem or BUG ! References: <20040811145310.37997.qmail@web54102.mail.yahoo.com> In-Reply-To: <20040811145310.37997.qmail@web54102.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/80 X-Sequence-Number: 10802 Elie Nacache wrote: > this.sqlDatas.moveToInsertRow(); > this.updateColumns(); > this.sqlDatas.insertRow(); The JDBC javadoc implies that calling insertRow() leaves the resultset on the insert row. This is what the driver implements. > this.sqlLineNumber = this.sqlDatas.getRow(); // INFO >> return 0 As the javadoc says, getRow() returns 0 if there is no current row. You're on the insert row so there is no current row. > INFO >> At this step there is no commit > INFO >> Second step update the row after collecting updated info > > this.sqlDatas.absolute(this.sqlLineNumber); // INFO >> throw the > exception What is the exception you see? The current development driver (see jdbc.postgresql.org) will treat absolute(0) as if you'd called beforeFirst(). Older drivers might do something different. > this.updateColumns(); > this.sqlDatas.updateRow(); > INFO >> If I fix the sqlLineNumber to 1 and force the absolute(1) > then no Execption is thrown but the modification is not seen in the > table. Looking at the driver source, it looks like the newly inserted row is appended to the resultset, so you should find it at the end of the resultset not the start. (I don't think making this assumption is portable, though). -O