Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 21442 invoked from network); 26 Nov 2010 12:08:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Nov 2010 12:08:46 -0000 Received: (qmail 60868 invoked by uid 500); 26 Nov 2010 12:08:46 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 60687 invoked by uid 500); 26 Nov 2010 12:08:43 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 60680 invoked by uid 99); 26 Nov 2010 12:08:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Nov 2010 12:08:43 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of linuxhippy@gmail.com designates 209.85.214.172 as permitted sender) Received: from [209.85.214.172] (HELO mail-iw0-f172.google.com) (209.85.214.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Nov 2010 12:08:35 +0000 Received: by iwn40 with SMTP id 40so2436301iwn.31 for ; Fri, 26 Nov 2010 04:08:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=XADExe/sx2hc4mKD6sB++fRqQKo+TIwnS0tG2XlNMwk=; b=mN7ovEdGFRLlU+rX3znxBo03Vs1rYoEMk1wysT9siMrrzQzAcVGLxDhkB+G5xBcd2g iEgbsl/V8noO8ME4manJXXcCkcq8M13IVL4i+rOdwMaRVszy6o6hjl7JY+5ilRj2iFEz 3y7oQ5z1211ubcXPrOhok/+uOjL3xK2IB6RWw= 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 :content-type; b=Ce2dqTglEzRf3BGBh4mr7HVD/20lBYSq7gV3aqtIwk5NJEEoGAy53UJDAyvwYfcAAq RmLeCbVEak4HT5yCwC+fmD/75hNid1yZGEkmPwOGWVFuHUpr0GYnw/luf/3S+gpT+lTf dM5rMoWhS1nawu6pTN/Yyye1m3IKpwmF4V+V8= MIME-Version: 1.0 Received: by 10.231.192.76 with SMTP id dp12mr1404566ibb.185.1290773294056; Fri, 26 Nov 2010 04:08:14 -0800 (PST) Received: by 10.231.16.135 with HTTP; Fri, 26 Nov 2010 04:08:13 -0800 (PST) In-Reply-To: References: Date: Fri, 26 Nov 2010 13:08:13 +0100 Message-ID: Subject: Re: Calling updateRow() after insertRow() leads to "java.sql.SQLException: Invalid cursor state" From: Clemens Eisserer To: Derby Discussion Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hi Dag, Thanks a lot for talking the time and writing some sample code :) > You need to do rowset.moveToInsertRow() first, I think. Without it you >> rowset.updateString("name", "1"); >> rowset.updateString("short", "2"); > > There is no column called "short" in the table, should be "ikey". Sorry, those were some left-overs when I tried to reduce production code to a test-case in a hurry. > Also, since you are using a scroll insensitive result set to support the > rowset, you'd need to do another query to see the inserted row (in > general, although you might get lucky, depending on whether the > underlying result set has already been inserted into the Derby cache > used to implement the insensitive semantics). Thats it, thanks a lot - PostgreSQL's and MySQL's JDBC driver silently append the row, even if it doesn't match the original query and without the need to re-run the query. Hmm, will take quite some time to make those changes, the original code falls more or less under the "don't touch" category ^^ Thanks again, Clemens