Hibernate version: 3
Name and version of the database you are using: Informix
Here's a snippet of the code fragment I'm using:
Code:
@Id
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ROW_UPD_TS")
public Calendar getRowUpdate()
{
return rowUpdate;
}
The Informix DDL to insert the row is:
Code:
ROW_UPD_TS datetime year to minute NOT NULL,
To get the current time, I use this piece of code:
Code:
public static Calendar getCurrentCalendar()
{
Calendar cal = Calendar.getInstance();
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal;
}
(I pull off the second and millisecond, because I save several rows at a time, which can take a few seconds, and getRowUpdate is part of the ID)
Now, I'm capable of persisting the object, and it persists everything just fine. However, it is persisting the data 5 hours later than what the current time is. Its saving it in GMT vs GMT-5 like it should.
I checked the timestamp of all the computers (including the DB server, webserver, appserver, and my local machine for test cases), and every made test cases for them to display the time after I create a calendar, and all of them are providing the correct time, yet when it goes through hibernate and saves, the saved value is in GMT. Is there a default within EJB3 or Hibernate3 that uses GMT? If so, can it be turned off??