Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A10E61337B8B for ; Fri, 1 Apr 2011 12:20:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 22155-03 for ; Fri, 1 Apr 2011 15:20:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from cpanelsmarthost1.zen.co.uk (cpanelsmarthost1.zen.co.uk [82.71.204.225]) by mail.postgresql.org (Postfix) with ESMTP id BED8F1337B47 for ; Fri, 1 Apr 2011 12:20:27 -0300 (ADT) Received: from [88.98.24.71] (helo=shcp03.hosting.zen.net.uk) by cpanelsmarthost1.zen.co.uk with esmtp (Exim 4.69) (envelope-from ) id 1Q5g9B-0002Ve-1l for pgsql-jdbc@postgresql.org; Fri, 01 Apr 2011 15:20:25 +0000 Received: from 88-96-216-206.dsl.zen.co.uk ([88.96.216.206] helo=[192.168.0.2]) by shcp03.hosting.zen.net.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Q5g92-00065H-K1; Fri, 01 Apr 2011 16:20:16 +0100 Message-ID: <4D95ED36.9070704@ahastie.net> Date: Fri, 01 Apr 2011 16:20:22 +0100 From: Andrew Hastie User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: Oliver Jowett CC: pgsql-jdbc@postgresql.org Subject: Re: Re-read of updated row using scrollable ResultSet returns old data References: <4D948DA4.3070901@ahastie.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - shcp03.hosting.zen.net.uk X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - ahastie.net X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/6 X-Sequence-Number: 21732 My mistake :-( Appears my test program had both of its tests the wrong way around, so after fixing and re-testing I can confirm that the behavior IS consistent with what the meta-data states for both "own" updates and "other" updates. It also means my tests against MS SQLServer and IBM DB2 for the "commercial" driver I'm using reveal that they don't support "own updates visible", so congrats to the PG project for getting this support in the driver unlike the competition! Apologies to all. Andrew On 03/31/2011 11:20 PM, Oliver Jowett wrote: > On 1 April 2011 03:20, Andrew Hastie wrote: >> It appears that the PG driver returns the original rather than the updated >> data values for an updatable ResultSet. This is where the updates are >> applied to a single table ResultSet in a single transaction. > That's not meant to happen. Do you have a testcase showing the problem? > >> INFO - Own updates visible for TYPE_SCROLL_INSENSITIVE = true >> INFO - Other updates visible for TYPE_SCROLL_INSENSITIVE = false >> INFO - Own updates visible for TYPE_SCROLL_SENSITIVE = true >> INFO - Other updates visible for TYPE_SCROLL_SENSITIVE = false >> If however you applied the row update using an SQL UPDATE on a separate >> Statement as opposed to using the ResultSet.updateX() methods within the >> same transaction, then you DO see the new value at step 8. I suggest both >> techniques should yield the same results. > That's also not meant to happen - the driver should behave according > to what the metadata claims (notably, "other updates" are not > visible). > I think we need to see your code here. > > Oliver