Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 91013 invoked from network); 12 Jun 2007 11:41:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jun 2007 11:41:47 -0000 Received: (qmail 94360 invoked by uid 500); 12 Jun 2007 11:41:51 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 94139 invoked by uid 500); 12 Jun 2007 11:41:50 -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 94130 invoked by uid 99); 12 Jun 2007 11:41:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 04:41:50 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 04:41:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2F4F37141E0 for ; Tue, 12 Jun 2007 04:41:26 -0700 (PDT) Message-ID: <8279336.1181648486109.JavaMail.jira@brutus> Date: Tue, 12 Jun 2007 04:41:26 -0700 (PDT) From: "Anurag Shekhar (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-2712) If large clob is updated after Reader. the reader continues to point to old data In-Reply-To: <11714766.1180344976585.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Anurag Shekhar updated DERBY-2712: ---------------------------------- Attachment: derby-2712v2.diff thanks Kristian for the review 1) Since the method EmbedClob.getInternalStream() has been added, why not rewrite the new ClobUpdateableReader constructor to only take the EmbedClob-object and fetch the stream by calling getInternalStream()? I have modified the constroctor to take only clob. 2) The code below can loop infinitely. + while (remainToSkip > 0) { + long skipBy = streamReader.skip(remainToSkip); + remainToSkip -= skipBy; A check to see if skipBy == 0 should be added, which if true means the EOF has been reached. One must consider under which scenarios this can happen (only programming error?). Would be better to fail "gracefully" instead of looping for ever. Fixed this problem. Now I am calling read if skip returns zero. If it returns -1 it will throw EOF exception and its able to read a char it will add 1 to skipped and continue. 3) The instance variable 'clob' in ClobUpdateableReader should be final. fixed 4) There are some typos in the JavaDoc. Might want to do another pass on it. 5) Quite a few occurrences of trailing spaces. fixed trailing spaces and typos 6) A bit unsure about this one in ClobUpdateableReader: + if (clob == null) { + throw new IOException ("Internal error while " + + "updating stream"); + } This can only happen if there is a programming error. Is IOException the right mechanism to communicate this? What about replacing it with a SanityManager.DEBUG/ASSERT? added sanity manager.assert. For issue 7. It will be good to remove dependency on length but as you rightly said it should be handled in a new jira. > If large clob is updated after Reader. the reader continues to point to old data > -------------------------------------------------------------------------------- > > Key: DERBY-2712 > URL: https://issues.apache.org/jira/browse/DERBY-2712 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.3.0.0 > Reporter: Anurag Shekhar > Assignee: Anurag Shekhar > Fix For: 10.3.0.0 > > Attachments: derby-2712.diff, derby-2712v2.diff > > > If a Reader is fetched from a large clob (obtained from ResultSet) a reader linked to the dvd stream is returned once a set method is called on it the clob data is materialized in control class but the Reader returned previously continues to point to old data. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.