Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 14877 invoked from network); 9 Jun 2010 22:43:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Jun 2010 22:43:44 -0000 Received: (qmail 46261 invoked by uid 500); 9 Jun 2010 22:43:43 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 46227 invoked by uid 500); 9 Jun 2010 22:43: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 46220 invoked by uid 99); 9 Jun 2010 22:43:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jun 2010 22:43:43 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.18.6.21] (HELO gmp-eb-inf-1.sun.com) (192.18.6.21) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jun 2010 22:43:34 +0000 Received: from fe-emea-13.sun.com (gmp-eb-lb-1-fe1.eu.sun.com [192.18.6.7] (may be forged)) by gmp-eb-inf-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id o59MhD1F023074 for ; Wed, 9 Jun 2010 22:43:13 GMT MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from conversion-daemon.fe-emea-13.sun.com by fe-emea-13.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) id <0L3R00B00QUDEB00@fe-emea-13.sun.com> for derby-user@db.apache.org; Wed, 09 Jun 2010 23:43:10 +0100 (BST) Received: from [192.168.1.154] ([unknown] [193.71.106.120]) by fe-emea-13.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) with ESMTPSA id <0L3R00BSYR3XC910@fe-emea-13.sun.com> for derby-user@db.apache.org; Wed, 09 Jun 2010 23:43:10 +0100 (BST) Date: Thu, 10 Jun 2010 00:43:31 +0200 From: Knut Anders Hatlen Subject: Re: Resetting ResultSet with first() or beforeFirst() In-reply-to: Sender: Knut.Hatlen@Sun.COM To: derby-user@db.apache.org Message-id: <4C101913.2000007@sun.com> References: User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.8) Gecko/20100412 Lightning/1.0b1 Thunderbird/3.0.3 X-Virus-Checked: Checked by ClamAV on apache.org On 06/10/10 12:25 AM, Pavel Bortnovskiy wrote: > > Thank you, Knut. > > Is there a large performance penalty for specifying > ResultSet.TYPE_SCROLL_INSENSITIVE, ||ResultSet.CONCUR_READ_ONLY? > For the sake of efficiency, should my code set those only when it is > necessary to reset the ResultSet? TYPE_SCROLL_INSENSITIVE makes the ResultSet materialize the full result as the application walks through it (in memory first, with overflow to disk when the size of the data structure reaches a certain threshold), so it has some overhead. But I've never tested how big the overhead is. CONCUR_READ_ONLY is the default concurrency mode, so that shouldn't affect the performance negatively. -- Knut Anders