Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 28036 invoked from network); 18 Mar 2010 22:44:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Mar 2010 22:44:48 -0000 Received: (qmail 80444 invoked by uid 500); 18 Mar 2010 22:44:48 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 80319 invoked by uid 500); 18 Mar 2010 22:44:48 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 80311 invoked by uid 99); 18 Mar 2010 22:44:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Mar 2010 22:44:48 +0000 X-ASF-Spam-Status: No, hits=-1062.0 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Mar 2010 22:44:47 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4A1B2234C4B1 for ; Thu, 18 Mar 2010 22:44:27 +0000 (UTC) Message-ID: <2118536543.353161268952267302.JavaMail.jira@brutus.apache.org> Date: Thu, 18 Mar 2010 22:44:27 +0000 (UTC) From: "Michael Dick (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1480) time zone info lost when using timestamp field In-Reply-To: <2022691140.11211264187181493.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-1480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847150#action_12847150 ] 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: 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 > Assignee: Michael Dick > Priority: Minor > Fix For: 1.3.0, 2.0.1 > > 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.