Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B011B7BAD for ; Fri, 9 Dec 2011 16:44:01 +0000 (UTC) Received: (qmail 52187 invoked by uid 500); 9 Dec 2011 16:44:01 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 52122 invoked by uid 500); 9 Dec 2011 16:44:01 -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 52022 invoked by uid 99); 9 Dec 2011 16:44:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Dec 2011 16:44:01 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Dec 2011 16:44:00 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E187A109794 for ; Fri, 9 Dec 2011 16:43:39 +0000 (UTC) Date: Fri, 9 Dec 2011 16:43:39 +0000 (UTC) From: "Rick Curtis (Commented) (JIRA)" To: dev@openjpa.apache.org Message-ID: <1785407119.58855.1323449019925.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2020098196.51908.1320258812343.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (OPENJPA-2068) Improve performance of java.util.Calendar fields 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-2068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13166293#comment-13166293 ] Rick Curtis commented on OPENJPA-2068: -------------------------------------- The code I committed doesn't have the quirk where you'll get a proxied instance when you issue a query where you only are selecting a Calendar field. Also, this behavior isn't configurable as it is transparent. > Improve performance of java.util.Calendar fields > ------------------------------------------------ > > Key: OPENJPA-2068 > URL: https://issues.apache.org/jira/browse/OPENJPA-2068 > Project: OpenJPA > Issue Type: Improvement > Components: jdbc > Affects Versions: 2.2.0 > Reporter: Rick Curtis > Assignee: Rick Curtis > Fix For: 2.2.0 > > Attachments: OPENJPA-2068.patch > > > While doing some performance testing, I've found that we could improve the performance of loading Entities that have java.util.Calendar fields. When loading the data into a Calendar field, we actually create two Calendar instances per field. Normally creating an extra instance wouldn't be that big of a deal, but since creating a Calendar is very expensive I would like to remove creation of the extra instance. > The call flow is something like this: > - em.find(...) // find an Entity which has a calendar field > ... execute query, processing result set... > - DBDictionary.getCalendar(ResultSet,...) // Here we pull a Timestamp out of the result set, and create an unproxied Calendar instance. > ... > // now while trying to store the Calendar into the Entity instance, we find that this type needs to be proxied. > SingleFieldManager.proxy(...) // Here we create the second Calendar instance, which is a proxied calendar > I'd like to add a configuration property to DBDictionary that tells the runtime to always create proxied calendar instances. This would remove the creation of the initial un-proxied instance. For a large majority of application which use Calendars this would help. > As always, there is a catch to this approach. If you were to execute a query such as : em.createQuery("SELECT c.myCal FROM CalendarEntity c where c.id=:id", MyCalendar.class), you would get back a proxied instance. This shouldn't be that big of a deal... but still a bit of a quirk. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira