1 2 Previous Next 20 Replies Latest reply on Feb 17, 2006 12:01 PM by epbernard

    Persistence of Date values depends on default time zone

      1. Persist an entity with a Date property
      2. Change the time zone of the JBoss server (or call TimeZone.setDefault)
      3. Read the entity from the persistence layer

      Now the Date property has a different value than before!

      This is extremely bad. Date objects are semantically not specific to a time zone and they store their internal state as milliseconds in GMT.

      This behaviour can lead to numerous problems:

      * Automatic system time zone changes between summer (daylightsavings) and winter time
      * Two JBoss instances in different time zones sharing a common database
      * Moving systems between time zones
      * Manually messing with a system's timezone configuration

      I would like to know how this timezone modality of the persistence layer can be addressed.

      I yet have to try out what happens when you change the TZ of the DB server...

        1 2 Previous Next