[jboss-jira] [JBoss JIRA] (WFLY-8530) Wrong ZonedDateTime value read when attribute annotated with @Id

Jörg Bäsner (JIRA) issues at jboss.org
Fri Apr 7 05:03:00 EDT 2017


     [ https://issues.jboss.org/browse/WFLY-8530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg Bäsner updated WFLY-8530:
------------------------------
    Steps to Reproduce: 
Attached is a simple maven project that can be used to reproduce this issue (a pre-build artifact is already contained in the archive). 

A README.md is included guiding through the steps needed...

The output will be:
~~~
10:31:35,094 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[0]: 1509231600, instant: 2017-10-28T23:00:00Z, toString: 2017-10-29T01:00+02:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T01:00+02:00[Europe/Berlin], offset: +02:00
10:31:35,941 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[1]: 1509235200, instant: 2017-10-29T00:00:00Z, toString: 2017-10-29T02:00+02:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T02:00+02:00[Europe/Berlin], offset: +02:00
10:31:35,944 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[2]: 1509238800, instant: 2017-10-29T01:00:00Z, toString: 2017-10-29T02:00+01:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T02:00+01:00[Europe/Berlin], offset: +01:00
10:31:35,949 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) ------------------------------------------------------------------------------------------------
10:31:35,949 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) -- Now read with Id on Value --
10:31:35,950 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) -- here all ZonedDateTimes are correct...
10:31:35,950 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) ------------------------------------------------------------------------------------------------
10:31:36,050 INFO  [org.hibernate.hql.internal.QueryTranslatorFactoryInitiator] (ServerService Thread Pool -- 65) HHH000397: Using ASTQueryTranslatorFactory
10:31:36,719 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[0]: 1509231600, instant: 2017-10-28T23:00:00Z, toString: 2017-10-29T01:00+02:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T01:00+02:00[Europe/Berlin], offset: +02:00
10:31:36,720 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[1]: 1509235200, instant: 2017-10-29T00:00:00Z, toString: *2017-10-29T02:00+02:00[Europe/Berlin]*, withZoneSameInstant: 2017-10-29T02:00+02:00[Europe/Berlin], offset: +02:00
10:31:36,720 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[2]: 1509238800, instant: 2017-10-29T01:00:00Z, toString: 2017-10-29T02:00+01:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T02:00+01:00[Europe/Berlin], offset: +01:00
10:31:36,720 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) ------------------------------------------------------------------------------------------------
10:31:36,720 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) -- Now read with Id on Timestamp --
10:31:36,721 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) -- here the epoch[1] is wrong...
10:31:36,721 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) ------------------------------------------------------------------------------------------------
10:31:36,736 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[0]: 1509231600, instant: 2017-10-28T23:00:00Z, toString: 2017-10-29T01:00+02:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T01:00+02:00[Europe/Berlin], offset: +02:00
10:31:36,737 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[1]: 1509238800, instant: 2017-10-29T01:00:00Z, toString: 2017-10-29T02:00+01:00[Europe/Berlin], withZoneSameInstant: *2017-10-29T02:00+01:00[Europe/Berlin]*, offset: +01:00
10:31:36,738 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[2]: 1509238800, instant: 2017-10-29T01:00:00Z, toString: 2017-10-29T02:00+01:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T02:00+01:00[Europe/Berlin], offset: +01:00
10:31:36,738 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) ------------------------------------------------------------------------------------------------
~~~

  was:
Attached is a simple maven project that can be used to reproduce this issue (a pre-build artifact is already contained in the archive). 

A README.md is included guiding through the steps needed...

The output will be:
~~~
10:31:35,094 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[0]: 1509231600, instant: 2017-10-28T23:00:00Z, toString: 2017-10-29T01:00+02:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T01:00+02:00[Europe/Berlin], offset: +02:00
10:31:35,941 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[1]: 1509235200, instant: 2017-10-29T00:00:00Z, toString: 2017-10-29T02:00+02:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T02:00+02:00[Europe/Berlin], offset: +02:00
10:31:35,944 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[2]: 1509238800, instant: 2017-10-29T01:00:00Z, toString: 2017-10-29T02:00+01:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T02:00+01:00[Europe/Berlin], offset: +01:00
10:31:35,949 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) ------------------------------------------------------------------------------------------------
10:31:35,949 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) -- Now read with Id on Value --
10:31:35,950 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) -- here all ZonedDateTimes are correct...
10:31:35,950 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) ------------------------------------------------------------------------------------------------
10:31:36,050 INFO  [org.hibernate.hql.internal.QueryTranslatorFactoryInitiator] (ServerService Thread Pool -- 65) HHH000397: Using ASTQueryTranslatorFactory
10:31:36,719 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[0]: 1509231600, instant: 2017-10-28T23:00:00Z, toString: 2017-10-29T01:00+02:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T01:00+02:00[Europe/Berlin], offset: +02:00
10:31:36,720 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[1]: 1509235200, instant: 2017-10-29T00:00:00Z, toString: 2017-10-29T02:00+02:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T02:00+02:00[Europe/Berlin], offset: +02:00
10:31:36,720 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[2]: 1509238800, instant: 2017-10-29T01:00:00Z, toString: 2017-10-29T02:00+01:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T02:00+01:00[Europe/Berlin], offset: +01:00
10:31:36,720 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) ------------------------------------------------------------------------------------------------
10:31:36,720 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) -- Now read with Id on Timestamp --
10:31:36,721 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) -- here the epoch[1] is wrong...
10:31:36,721 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) ------------------------------------------------------------------------------------------------
10:31:36,736 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[0]: 1509231600, instant: 2017-10-28T23:00:00Z, toString: 2017-10-29T01:00+02:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T01:00+02:00[Europe/Berlin], offset: +02:00
10:31:36,737 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[1]: 1509238800, instant: 2017-10-29T01:00:00Z, toString: 2017-10-29T02:00+01:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T02:00+01:00[Europe/Berlin], offset: +01:00
10:31:36,738 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) epoch[2]: 1509238800, instant: 2017-10-29T01:00:00Z, toString: 2017-10-29T02:00+01:00[Europe/Berlin], withZoneSameInstant: 2017-10-29T02:00+01:00[Europe/Berlin], offset: +01:00
10:31:36,738 INFO  [org.jboss.jbaesner.playground.jpa.TimeTestStartupBean] (ServerService Thread Pool -- 65) ------------------------------------------------------------------------------------------------
~~~



> Wrong ZonedDateTime value read when attribute annotated with @Id
> ----------------------------------------------------------------
>
>                 Key: WFLY-8530
>                 URL: https://issues.jboss.org/browse/WFLY-8530
>             Project: WildFly
>          Issue Type: Bug
>          Components: JPA / Hibernate
>    Affects Versions: 10.1.0.Final
>            Reporter: Jörg Bäsner
>            Assignee: Scott Marlow
>         Attachments: playground-prj.tar.gz
>
>
> A ZonedDateTime entity attribute annotated with @Id returns the wrong value when read from the database. When the annotation @Id is not present, the value is returned correctly.
> The special timestamp of Germanys daylight saving in October 2017 "2017-10-29T02:00:00+02:00" is returned after read as follows:
> * with @Id: 2017-10-29T02:00+*01:00*[Europe/Berlin] <- *WRONG*
> * without @Id: 2017-10-29T02:00+*02:00*[Europe/Berlin] <- *CORRECT*



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)



More information about the jboss-jira mailing list