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 2021/03/19 12:53:00 UTC

[jira] [Comment Edited] (CAY-2691) MySQL driver 8.0.x stores LocalDateTime differently than 5.1.x

    [ https://issues.apache.org/jira/browse/CAY-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17234610#comment-17234610 ] 

Nikita Timofeev edited comment on CAY-2691 at 3/19/21, 12:52 PM:
-----------------------------------------------------------------

*4.2*: https://github.com/apache/cayenne/commit/3b64f0c1b2583ab505f32e1a14569a199e00b566


was (Author: ntimofeev):
https://github.com/apache/cayenne/commit/3b64f0c1b2583ab505f32e1a14569a199e00b566

> 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
>            Priority: Major
>             Fix For: 4.1.1, 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)