From derby-dev-return-88547-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Sun Jun 19 07:58:33 2011 Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 095194F2C for ; Sun, 19 Jun 2011 07:58:33 +0000 (UTC) Received: (qmail 79704 invoked by uid 500); 19 Jun 2011 07:58:32 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 79678 invoked by uid 500); 19 Jun 2011 07:58:32 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 79671 invoked by uid 99); 19 Jun 2011 07:58:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Jun 2011 07:58:32 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [72.35.23.34] (HELO out2a.electric.net) (72.35.23.34) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Jun 2011 07:58:24 +0000 Received: from [10.86.5.46] (helo=fuse246.electric.net) by out2a.electric.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1QYCtQ-0007oO-TN for derby-dev@db.apache.org; Sun, 19 Jun 2011 00:58:04 -0700 Received: from mailanyone.net by fuse246.electric.net with esmtpsa (TLSv1:AES256-SHA:256) (MailAnyone extSMTP dbrosius@baybroadband.net) id 1QYCtO-0000uL-6u for derby-dev@db.apache.org; Sun, 19 Jun 2011 00:58:03 -0700 Message-ID: <4DFDAC01.1090500@apache.org> Date: Sun, 19 Jun 2011 03:57:53 -0400 From: Dave Brosius User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Is this ok? Content-Type: multipart/alternative; boundary="------------010400090606070408040702" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------010400090606070408040702 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Perhaps this ok, but seems odd to me, just double checking... ScrollInsensitiveResultSet around line 321 If the row hasn't been seen yet, if scans rows till it finds the row which is fine, then once found, if the result is *found*, it looks it up again in the hashtable which seems odd if (row > 0) { // position is from the start of the result set if (row <= positionInSource) { // We've already seen the row before return getRowFromHashTable(row); } /* We haven't seen the row yet, scan until we find * it or we get to the end. */ int diff = row - positionInSource; ExecRow result = null; while (diff > 0) { if ((result = getNextRowFromSource()) != null) { diff--; } else { break; } } *if (result != null) { result = getRowFromHashTable(row); }* currentRow = result; return result; } --------------010400090606070408040702 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Perhaps this ok, but seems odd to me, just double checking...

ScrollInsensitiveResultSet around line 321

If the row hasn't been seen yet, if scans rows till it finds the row which is fine,
then once found, if the result is found, it looks it up again in the hashtable which seems odd


        if (row > 0)
        {
            // position is from the start of the result set
            if (row <= positionInSource)
            {
                // We've already seen the row before
                return getRowFromHashTable(row);
            }
           
            /* We haven't seen the row yet, scan until we find
             * it or we get to the end.
             */
            int diff = row - positionInSource;
            ExecRow result = null;
            while (diff > 0)
            {
                if ((result = getNextRowFromSource()) != null)
                {
                    diff--;
                }
                else
                {
                    break;
                }
            }
            if (result != null) {
                result = getRowFromHashTable(row);
            }

            currentRow = result;
            return result;
        }
--------------010400090606070408040702--