General
cancel
Showing results for 
Search instead for 
Did you mean: 

Misinterpretation of current dates on HP-UX

Swastik Patel
Occasional Visitor

Misinterpretation of current dates on HP-UX

Hi,

We are facing an issue on HP-UX (ver 11i) JDK 1.4.2.13 whereby current dates are being misinterpreted as dates in the future. For example a date such as 2008-11-05 00:00:00.0 is being misinterpreted as 2280-08-06 03:35:14.0 when the following call is made:

java.sql.PreparedStatement.setTimestamp(1, new java.sql.Timestamp.Timestamp(startDate.getTime()))

where startDate is of type java.util.Date and in this case would be 2008-11-05. This call sets the timestamp parameter in a prepared statement to be executed against the database. From our analysis, we feel that the issue could be occurring due to the JIT compiler incorrectly compiling the above call. The issue is not readily reproducible, hence we can't be a 100% sure.

I was wondering if anyone has experienced a similar issue and what the resolution was. I found a similar thread ( http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1226085465927+28353475&threadId=58414 ) from some time back, however a solution is not documented.

Any thoughts would be appreciated.

Thanks.

SP
2 REPLIES
Johnson Punniyalingam
Honored Contributor

Re: Misinterpretation of current dates on HP-UX

Hi Patel,

does the "date" command also Misinterpretation of current dates on HP-UX .?

Do you time sync the server with your "NTP_Server"..?

if not either you can time_sync HPUX Server with your ntp server. using ntp

ntpq -p or could be you firewall ipaddress,

Thanks,
Johnson

Problems are common to all, but attitude makes the difference
Swastik Patel
Occasional Visitor

Re: Misinterpretation of current dates on HP-UX

Hi Johnson,

Thanks for the reply. The 'date' command on the server returns correctly.

We find that the misinterpretation only starts when the method containing the above call gets called repeatedly. Unfortunately, we haven't been able to determine how many times.

Swastik