[ 
https://issues.apache.org/jira/browse/OPENJPA-1480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

B.J. Reed updated OPENJPA-1480:
-------------------------------

    Attachment: 1280-1.2.x.patch

Uploading 1280-1.2.x.patch.

This patch contains a one line code change for 1.2.x and trunk.  If the user 
overwrites DBDictionary, then they would be able to get time zome info from the 
DB, then the time zone is lost in the SingleFieldManager class.  But since 
OpenJPA does not currenly get the time zone info, then this actually breaks 3 
test cases which really need to be rewritten so that their time zone info isn't 
hard coded into the entity.
org.apache.openjpa.jdbc.metaTestCalendarField.testCalendarField
org.apache.openjpa.persistence.kernel.TestCalendarFields.TestFieldDefaultTimeZone
org.apache.openjpa.persistence.kernel.TestCalendarFields.TestTimeZoneEquals

The first 2 are essentially the same test case, I'd say we just remove the 
TestCalendarField class since it only has the one test.  Then we'd need to 
disable the 2 (now will be) failing test cases in TestCalendarFields.

As Mike and Craig suggest, when we do fix the rest of this in trunk, we can add 
these 2 test cases back in and fix them at that time.


> time zone info lost when using timestamp field
> ----------------------------------------------
>
>                 Key: OPENJPA-1480
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1480
>             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
>            Priority: Minor
>             Fix For: 1.2.3, 1.3.0, 2.0.0
>
>         Attachments: 1280-1.2.x.patch, OPENJPA-1480-TestCalendarField.patch, 
> TestTimeZone.java, TZDataModel.java
>
>
> 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.

Reply via email to