-->
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.  [ 3 posts ] 
Author Message
 Post subject: Time persistence issue due to Timezone
PostPosted: Mon May 02, 2005 3:30 pm 
Newbie

Joined: Tue Dec 02, 2003 9:12 am
Posts: 7
Hi,

My application deals with the dates based on a custom time zone. We needed one without day light savings. So we set the default time zone to the custom time zone. Our database uses the default timezone. Now when I persist, I face problem with some columns alone. Especially when I use
Code:
new Date()
.

Below is the mapping I use

<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

Code:
<hibernate-mapping>
   <class name="com.nielsenmedia.myevnts.entity.CableLineup" table="Lineup"
      dynamic-update="true" dynamic-insert="true" >
      <id name="seqID" type="long" column="seqID" unsaved-value="any">
         <generator class="assigned"/>
      </id>
      <version name="changedDateTime" type="timestamp"
         column="changedDateTime" />
      <property name="startDateTime" type="java.util.Date"
         update="true" insert="true" column="startDateTime"
         not-null="true" />
   </class>
   
   
</hibernate-mapping>


Now when I persist startDateTime is getting persisted as I give. But the changedDateTime is short of one hour.

Any help?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 02, 2005 3:37 pm 
Newbie

Joined: Tue Dec 02, 2003 9:12 am
Posts: 7
I use sybase database and both the attributes are of type datetime in the database.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 11:02 am 
Newbie

Joined: Tue Dec 02, 2003 9:12 am
Posts: 7
If this would happen when the timezone is different in database and java application. Then I should get wrong updates consistently. My problem here is, it is getting updated properly in some cases and in some it is not. Is there any additional information required. This is quite critical for my application. I would appreciate any help in this regard.


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

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.