Re: Re-read of updated row using scrollable ResultSet returns old data

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Andrew Hastie <andrew(at)ahastie(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Re-read of updated row using scrollable ResultSet returns old data
Date: 2011-03-31 22:20:57
Message-ID: AANLkTikAah5yDdMqM0JjfJvwT-0xwgNzDBX7x6d8EN1Z@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 1 April 2011 03:20, Andrew Hastie <andrew(at)ahastie(dot)net> 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2011-03-31 22:24:03 Re: Cannot open connection while insert much data.
Previous Message Jeff Hubbach 2011-03-31 22:02:26 Re: JDBC gripe list (the autocommit subthread)