Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 47940 invoked from network); 11 Jun 2007 09:15:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jun 2007 09:15:49 -0000 Received: (qmail 19286 invoked by uid 500); 11 Jun 2007 09:15:50 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 19260 invoked by uid 500); 11 Jun 2007 09:15: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 19251 invoked by uid 99); 11 Jun 2007 09:15:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2007 02:15: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; Mon, 11 Jun 2007 02:15:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0D0727141F4 for ; Mon, 11 Jun 2007 02:15:26 -0700 (PDT) Message-ID: <2963598.1181553326034.JavaMail.jira@brutus> Date: Mon, 11 Jun 2007 02:15: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-2712.diff I have modified EmbedClob.getCharacterStream to return ClobUpdateableReader. ClobUpdateableReader is modifed to detect if the Clob has moved from Readonly InternalClob to a writable InternalClob. If the EmbedClob moves from readonly mode to writable mode it fetches the input stream again from the EmbedClob and skips to the current position. Code to invalidate the internal Reader in case the underlying stream is modified was already part of this Reader. Updated files java/engine/org/apache/derby/impl/jdbc/EmbedClob.java Added two methods isWritable ClobUpdateableReader uses this methods to determine if the Clob has swtched from a readonly InternalClob to a writable InternalClob. getInternalStream ClobUpdateableReader uses this method if it detects Clob is modified since creating ClobUpdateableReader. Modified getCharacterStream() to return ClobUpdateableReader. java/engine/org/apache/derby/impl/jdbc/ClobUpdateableReader.java added a new constructor. This constructor will be used by EmbedClob. It accepts Clob as a parameter Clob object is used to check if the InternalClob its using is writable or not. In case it was read only in the begning ClobUpdateableReader uses getInternalStream to refresh the stream after it switches to writable InternalClob. Added a new private method updateIfRequired which is called in every method to check if the underlying stream has changed. java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClobUpdateableReaderTest.java Added a new test for switching from StoreStream to ClobStreamControl. > 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 > Attachments: derby-2712.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.