You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Nikita Timofeev (Jira)" <ji...@apache.org> on 2020/11/12 15:56:00 UTC
[jira] [Created] (CAY-2691) MySQL driver 8.0.x stores LocalDateTime
differently than 5.1.x
Nikita Timofeev created CAY-2691:
------------------------------------
Summary: MySQL driver 8.0.x stores LocalDateTime differently than 5.1.x
Key: CAY-2691
URL: https://issues.apache.org/jira/browse/CAY-2691
Project: Cayenne
Issue Type: Bug
Components: Database integration
Environment: MySQL
Reporter: Nikita Timofeev
Assignee: Nikita Timofeev
Fix For: 4.2.M3
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|https://lists.apache.org/thread.html/r30735c36ba034e280c6a20f2a6910f1cb6aa1f906b6234b8b1c9fe1c%40%3Cuser.cayenne.apache.org%3E]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)