You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2010/04/07 11:36:34 UTC

[jira] Commented: (DERBY-4582) Timestamps inserted with GMT calendar are 1 hour later when subsequently read with GMT calendar (Server Mode Only).

    [ https://issues.apache.org/jira/browse/DERBY-4582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12854404#action_12854404 ] 

Knut Anders Hatlen commented on DERBY-4582:
-------------------------------------------

I see this too when I set the default timezone of my JVM to America/Chicago and run the test class. I also see the problem when I run with my local timezone (Central European time) and adjust the dates in the test to match the DST change in that timezone.

If I keep the table populated by the client/server test and run the embedded test against it, I also see the problem in the embedded test, so it seems that embedded and client actually end up writing different dates to the database.

If I do it the other way around, and run client/server tests against a table created by the embedded test, I still see the problem, but the number of discrepancies has been reduced from six to one. So it looks like we also have an issue with reading the values from the database.

> Timestamps inserted with GMT calendar are 1 hour later when subsequently read with GMT calendar (Server Mode Only).
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4582
>                 URL: https://issues.apache.org/jira/browse/DERBY-4582
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.5.3.0
>         Environment: Windows XP Professional Version 2002 Service Pack 3,  Central Standard Time Zone (America/Chicago)
>            Reporter: Keith Kruse
>         Attachments: DerbyTest.java
>
>
> This issue only appears to happen in Network Server/Client mode.  Embedded mode does not have the issue.
> My timezone is American/Chicago.  Saving timestamps with values for the 6 hours prior to DST start are being read back in as values 1 hour later than written.  (I believe the issue happens on the write because values written in Network Server/Client mode and read in Embedded mode are incorrect, while values written and read in Embedded mode are corect.)
> Values between 3/13/2010 - 20:00 CST and 3/14/2010 - 02:00 CST will return timstamps 1 hour off.  The "setTimestamp" method is being passed a GMT calendar with the timestamp:
> I have a complete test class I can attach, but here is a summary:
> private final TimeZone gmtTZ = TimeZone.getTimeZone("GMT");
> private final Calendar gmtCal = Calendar.getInstance(gmtTZ);
> ...
> String sql = "INSERT INTO app.dst_test (id, gmt_timestamp, milli_time) VALUES(?,?,?)";
> String sql2 = "SELECT * from app.dst_test where id=?";
> ...
> ps.setTimestamp(2, ts, gmtCal);
> ...
> Timestamp tsRead = rs.getTimestamp("gmt_timestamp", gmtCal);
> ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.