Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 617816382A6 for ; Thu, 14 Jan 2010 11:02:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 78361-07 for ; Thu, 14 Jan 2010 15:02:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from web2.nidhog.com (web2.nidhog.com [66.207.132.3]) by mail.postgresql.org (Postfix) with ESMTP id 8114663400B for ; Thu, 14 Jan 2010 11:02:27 -0400 (AST) Received: from XP2 (pool-141-158-68-201.pitt.east.verizon.net [141.158.68.201]) (authenticated bits=0) by web2.nidhog.com (8.14.3/8.13.8) with ESMTP id o0EF2Ix3083876 for ; Thu, 14 Jan 2010 10:02:20 -0500 (EST) (envelope-from john@johntdow.com) Message-Id: <201001141502.o0EF2Ix3083876@web2.nidhog.com> From: "John T. Dow" To: "pgsql-jdbc@postgresql.org" Date: Thu, 14 Jan 2010 10:02:03 -0500 X-Mailer: PMMail 2000 Professional (2.20.2717) For Windows 2000 (5.1.2600;3) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: refreshRow is slow X-Nidhog-MailScanner-Information: Please contact the ISP for more information X-Nidhog-MailScanner: Found to be clean X-Nidhog-MailScanner-From: john@johntdow.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.005 tagged_above=-10 required=5 tests=AWL=1.594, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/16 X-Sequence-Number: 20212 I am having no luck getting responses to a question I posted earlier about optimistic locking with multiple rows. I'll ask a more targeted question. How do I efficiently refresh a single row in a resultset? Suppose I allow users to view multiple records with TYPE_SCROLL_INSENSITIVE, CONCUR_READ_ONLY. The user might select one row or 1,000 rows and scroll back and forth at will. The user might choose to change one of the rows. I do this with a separate FOR UPDATE query. The update query will fetch the current row, which might be different from the row in the original resultset. My programming compares the two rows and can report to the user the differences. After the row has been updated, I need to refresh that row in the result set so that if the user continues to scroll back and forth, it will see the updated information. I am using refreshRow. I do setFetchSize(1) first. This works, but sometimes it is very slow. It can take many seconds over a remote connection. Can I fix that? What's going on? Note: I don't want to use TYPE_SCROLL_SENSITIVE because it would update the row in the result set silently and I wouldn't be able to tell the user that somebody had changed anything. (Besides, I understand that TYPE_SCROLL_SENSITIVE doesn't work reliably.) Thanks John