Derby
  1. Derby
  2. DERBY-3173

Removed cached String objects from SQLDate, SQLTime and SQLTimestamp

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.7.1.1
    • Component/s: SQL
    • Labels:
      None
    • Issue & fix info:
      Newcomer

      Description

      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.

      1. d3173_warning.diff
        0.6 kB
        Eranda Sooriyabandara
      2. d3173.diff
        7 kB
        Knut Anders Hatlen
      3. Derby-3173.diff
        6 kB
        Eranda Sooriyabandara
      4. Derby-3173.diff
        5 kB
        Eranda Sooriyabandara
      5. sqldate.diff
        2 kB
        Knut Anders Hatlen
      6. Derby-3173.diff
        2 kB
        Eranda Sooriyabandara

        Activity

        Daniel John Debrunner created issue -
        Kathey Marsden made changes -
        Field Original Value New Value
        Derby Categories [Newcomer]
        Dag H. Wanvik made changes -
        Issue & fix info [Newcomer]
        Eranda Sooriyabandara made changes -
        Attachment Derby-3173.diff [ 12452293 ]
        Knut Anders Hatlen made changes -
        Attachment sqldate.diff [ 12452807 ]
        Eranda Sooriyabandara made changes -
        Assignee Eranda Sooriyabandara [ eranda ]
        Eranda Sooriyabandara made changes -
        Attachment Derby-3173.diff [ 12453065 ]
        Eranda Sooriyabandara made changes -
        Attachment Derby-3173.diff [ 12453146 ]
        Knut Anders Hatlen made changes -
        Attachment d3173.diff [ 12453163 ]
        Knut Anders Hatlen made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 10.7.0.0 [ 12314971 ]
        Resolution Fixed [ 1 ]
        Eranda Sooriyabandara made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Eranda Sooriyabandara made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Eranda Sooriyabandara made changes -
        Attachment d3173_warning.diff [ 12453496 ]
        Knut Anders Hatlen made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Rick Hillegas made changes -
        Fix Version/s 10.7.1.1 [ 12315564 ]
        Fix Version/s 10.7.1.0 [ 12314971 ]
        Knut Anders Hatlen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gavin made changes -
        Workflow jira [ 12416365 ] Default workflow, editable Closed status [ 12802755 ]

          People

          • Assignee:
            Eranda Sooriyabandara
            Reporter:
            Daniel John Debrunner
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development