Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-2691

MySQL driver 8.0.x stores LocalDateTime differently than 5.1.x

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.1, 4.2.M3
    • Component/s: Database integration
    • Labels:
      None
    • Environment:
      MySQL

      Description

      MySQL driver version 8.0.x uses java default timezone info to adjust LocalDateTime value stored in the DB. This process is symmetrical, so the result is OK for the Cayenne itself. But the exact value is different from the 5.1.x version, and, more importantly, this could cause problems with other systems that could read values directly from the DB.

      The solution is to use additional Calendar parameter in the statement.setTimestamp(), statement.setDate() and statement.setTime() methods.

      See also this mail thread

        Attachments

          Activity

            People

            • Assignee:
              ntimofeev Nikita Timofeev
              Reporter:
              ntimofeev Nikita Timofeev
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: