Hello,
I have recognized a strange problem:
The application runs on tomcat5.5 with spring1.2, hibernate3 and the DB is mysql 5.
The datetimes in mysql are ok. (I have checked with unix_timestamp()!)
Sometimes the datetime-value in Hibernate (in java.util.Date) is one hour after the datetime-value in mysql.
This effect occurs, if,
- The systemclock goes wrong (behind actual time, 5 seconds every minute, and is synchronized by timeserver every 30 minutes)
- The mysql is started at system-clock-situation: actualTime - 50 seconds
- The tomcat is started at system-clock-situation: actualTime - 10 seconds
The Situation can be fixed, if:
- first synchronize the systemclock via timeserver
- then start mysql-server
- last start tomcat
- all between one minute
My questions:
Can anybody explain this effect?
Is there a configuration-property to force the transfer of datetimes from mysql to hibernate-model in a native (in a UTC-manner)?
(in mysql the time is stored in UTC, the java.util.Date is based on UTC and in my application I use only UTC-Times.)
Thanks for your answer in advance.
Regards
Wolfgang
|