Re: refreshRow is slow - Mailing list pgsql-jdbc

From John T. Dow
Subject Re: refreshRow is slow
Date
Msg-id 201001201408.o0KE87vp082207@web2.nidhog.com
Whole thread Raw
In response to Re: refreshRow is slow  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
Having decided that refreshRow is going to be too slow sometimes (because it does a query for each column to see if
it'sa primary key), I am for the time being revising my standard application logic to execute the original query again. 

A small complication has developed. There is no guarantee that the rows will be returned in the same order, unless the
orderis explicitly stated in the query. Since my queries are usually user-defined (that is, generated by the
applicationbased on user requests in a non-SQL syntax), I'll have to do something like sort on the primary keys in all
cases.Not necessarily a bad thing to do I suppose. 

But another complication might be confusing to the users. Suppose someone else has added a row. Executing the original
querybrings up more rows than originally. If the user has been scrolling back and forth through the result set,
suddenlya new row will appear. Also possible, someone deletes a row, so it disappears. That is likely to generate a
phonecall to me ("What happened?"). 

It sure would be nice if refreshRow was more efficient in learning which are the primary keys.

John


pgsql-jdbc by date:

Previous
From: "Donald Fraser"
Date:
Subject: Re: Mapping Java BigDecimal
Next
From: "Satish Burnwal (sburnwal)"
Date:
Subject: How to use JDBC to update LargeObject