Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 78599 invoked from network); 23 Aug 2010 11:59:42 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Aug 2010 11:59:42 -0000 Received: (qmail 63869 invoked by uid 500); 23 Aug 2010 11:59:42 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 63161 invoked by uid 500); 23 Aug 2010 11:59:39 -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 63148 invoked by uid 99); 23 Aug 2010 11:59:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Aug 2010 11:59:38 +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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Aug 2010 11:59:37 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o7NBxGHD005131 for ; Mon, 23 Aug 2010 11:59:17 GMT Message-ID: <20381602.504331282564756701.JavaMail.jira@thor> Date: Mon, 23 Aug 2010 07:59:16 -0400 (EDT) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-3173) Removed cached String objects from SQLDate, SQLTime and SQLTimestamp In-Reply-To: <7472371.1194030470929.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-3173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-3173: -------------------------------------- Attachment: sqldate.diff Hi Eranda, Thanks for posting the patch. Your changes look good to me. I'm running the regression tests now and intend to commit it if the tests run cleanly. Before starting the tests, I made two minor changes to your patch (see the attached sqldate.diff): 1) Removed trailing blanks. 2) Narrowed the scope of the local variable valueString in getString() since it's only used inside the first branch of the if statement. > Removed cached String objects from SQLDate, SQLTime and SQLTimestamp > -------------------------------------------------------------------- > > Key: DERBY-3173 > URL: https://issues.apache.org/jira/browse/DERBY-3173 > Project: Derby > Issue Type: Improvement > Components: SQL > Reporter: Daniel John Debrunner > Priority: Minor > Attachments: Derby-3173.diff, sqldate.diff > > > These type classes save a copy of the value when it is converted to a String (e.g. through a ResultSet.getString()). This complicates the code & increases memory use for little value, in most cases the cached value will never be used. E.g. for any type of scan the String value will be discarded when moving to the next row. In most cases applications do not call getString() twice on a column. > The code has some historical basis in the fact that these types used to be represented by a java.sql.Time/Date/Timestamp object and its conversion to String was slow. Now the conversion of all these types to a String is simple. > In addition I think the getString() will sometimes return a non-normalized form, if the value is set by a non-standard format then the cached String is set to the non-standard format, not the standard format, I believe this is incorrect. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.