db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Kruse (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4582) Timestamps inserted with GMT calendar are 1 hour later when subsequently read with GMT calendar (Server Mode Only).
Date Mon, 15 Mar 2010 16:59:27 GMT

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

Keith Kruse commented on DERBY-4582:

I believe so:

C:\tzupdater-1.3.25-2009u>java -jar tzupdater.jar -u

C:\tzupdater-1.3.25-2009u>java -jar tzupdater.jar -t -v
java.home: C:\Program Files\Java\jre6
java.vendor: Sun Microsystems Inc.
java.version: 1.6.0_18
JRE time zone data version: tzdata2009u
Embedded time zone data version: tzdata2009u
Validating the time zone data
Validation complete

===   Starting Derby Server  ===

C:\db-derby-10.5.3\bin>java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)

2010-03-15 16:49:22.094 GMT : Security manager installed using the Basic server security policy.
2010-03-15 16:49:22.501 GMT : Apache Derby Network Server - - (802917) started and
ready to accept connections on port 1527

===   Logging Java Runtime in test class===

I added this to my test class:

   log("Java Runtime Version: " + System.getProperty("java.runtime.version"));
   log("Java Path: " + System.getProperty("sun.boot.library.path"));

and I get:

   Java Runtime Version: 1.6.0_18-b07
   Java Path: C:\Program Files\Java\jre6\bin

> 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:
>         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.

View raw message