Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 56581 invoked from network); 8 Jun 2009 12:18:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Jun 2009 12:18:20 -0000 Received: (qmail 92991 invoked by uid 500); 8 Jun 2009 12:18:32 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 92924 invoked by uid 500); 8 Jun 2009 12:18: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 92916 invoked by uid 99); 8 Jun 2009 12:18:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jun 2009 12:18:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jun 2009 12:18:29 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B90CF234C004 for ; Mon, 8 Jun 2009 05:18:07 -0700 (PDT) Message-ID: <468373510.1244463487743.JavaMail.jira@brutus> Date: Mon, 8 Jun 2009 05:18:07 -0700 (PDT) From: "Kristian Waagan (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-4241) Improve transition from read-only to writable Clob representation In-Reply-To: <1332013969.1242977685533.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12717241#action_12717241 ] Kristian Waagan commented on DERBY-4241: ---------------------------------------- Committed patch 1a to trunk with revision 782600. I'll wait a few more days with patch 2a, hoping that someone will have a look at it. > Improve transition from read-only to writable Clob representation > ----------------------------------------------------------------- > > Key: DERBY-4241 > URL: https://issues.apache.org/jira/browse/DERBY-4241 > Project: Derby > Issue Type: Sub-task > Components: JDBC > Affects Versions: 10.5.1.1, 10.6.0.0 > Reporter: Kristian Waagan > Assignee: Kristian Waagan > Priority: Minor > Attachments: derby-4241-1a-InternalClob.getLengthIfKnown.diff, derby-4241-2a-utf8AwareCopy.diff > > > When a store stream Clob is going to be modified, it will be written out to the temporary area of Derby and represented as a TemporaryClob. > The transfer of the data is done in a sub-optimal manner for two reasons; > o for transfer of the complete Clob, the copy method operates on the byte level and we're not able to save the character length. > o for transfer of parts of the Clob (i.e. truncation), we have to first decode the UTF-8 encoding to find the byte count and then transfer the same bytes. > I intend to do the following two changes; > 1) Add a getCharLengthIfKnow-method to InternalClob. > 2) Add a UTF-8 aware copy method to LOBStreamControl. > When a complete Clob is to be copied, code like this will be executed; > cachedCharLength = internalClob.getLengthIfKnown(); > if (cachedCharLength > 0) > // use existing byte-oriented copy method for best performance (copy until EOF) > else > cachedCharLength = control.copyUTF8Data() > When parts of a Clob is to be copied, we always use the UTF-8 aware copy method, but we also do a cheap range check. > cachedCharLength = internalClob.getLengthIfKnown(); > if (cachedCharLength > 0 && requestedLength > cachedCharLength) > throw EOFException(); > if (cachedCharLength == requestedLength) > // use existing byte-oriented copy method for best performance (copy until EOF) > else > cachedCharLength = control.copyUTF8Data(requestedLength); > Adding the UTF-8 aware copy method was started under DERBY-4023, including comments on the first revision of a patch. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.