-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem with datetime-difference in hibernate
PostPosted: Thu Apr 12, 2007 10:11 am 
Newbie

Joined: Thu Apr 12, 2007 7:07 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.