Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3173

Removed cached String objects from SQLDate, SQLTime and SQLTimestamp

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 10.7.1.1
    • SQL
    • None
    • 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.

      Attachments

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

        Activity

          People

            eranda Weerasekara Mudiyanselage Eranda Mahesh Sooriyabandara
            djd Daniel John Debrunner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: