openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick (JIRA)" <>
Subject [jira] Commented: (OPENJPA-1480) time zone info lost when using timestamp field
Date Thu, 18 Mar 2010 22:44:27 GMT


Michael Dick commented on OPENJPA-1480:

The problem here is that we don't have a good mechanism for detecting whether we need to overwrite
the timezone. 

Some databases support storing the timezone, some do not. In either case we'd need support
in the DBDictionary to load the type appropriately. But at the point where we set the timezone
we have no access to the Dictionary (or the JDBC module for that matter). 

If we arbitrarily set the timezone then we may overwrite a value set intentionally by the
user (demonstrated in Marc's testcase). This is what B.J.'s patch does so I'm reluctant to
commit it. 

Overall I think this needs to be handled directly by the application unless there's an alternative
I haven't thought of. 

> time zone info lost when using timestamp field
> ----------------------------------------------
>                 Key: OPENJPA-1480
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 1.2.3, 1.3.0, 2.0.0-M3, 2.0.0-beta
>         Environment: at least DB2, Derby, Sybase
>            Reporter: B.J. Reed
>            Assignee: Michael Dick
>            Priority: Minor
>             Fix For: 1.3.0, 2.0.1
>         Attachments: 1280-1.2.x.patch, OPENJPA-1480-TestCalendarField.patch,,
> Looks like OpenJPA always gets the time stamp out at the time zone of the machine, not
the time zone that was used originally.
> The test case is putting in 2 TimeStamps
>     TTimestamp = 4-3-2004 21:0:0.0 (America/New_York)
>     TTimestampUTC = 4-4-2004 2:0:0.0 (UTC)
> When OpenJPA gets those 2 timesamps back out of the database, they are 
>     TTimestamp = 4-3-2004 21:0:0.0 (America/New_York)
>     TTimestampUTC = 4-3-2004 21:0:0.0 (America/New_York)

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

View raw message