db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-3173) Removed cached String objects from SQLDate, SQLTime and SQLTimestamp
Date Mon, 23 Aug 2010 11:59:16 GMT

     [ 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.


Mime
View raw message