From dev-return-6377-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Thu Oct 04 20:43:38 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 82517 invoked from network); 4 Oct 2007 20:43:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Oct 2007 20:43:37 -0000 Received: (qmail 61859 invoked by uid 500); 4 Oct 2007 20:43:26 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 61706 invoked by uid 500); 4 Oct 2007 20:43:26 -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 61697 invoked by uid 99); 4 Oct 2007 20:43:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2007 13:43:26 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ppoddar@bea.com designates 66.248.192.39 as permitted sender) Received: from [66.248.192.39] (HELO repmmg02.bea.com) (66.248.192.39) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2007 20:43:27 +0000 Received: from repmmr02.bea.com (repmmr02.bea.com [10.160.30.72]) by repmmg02.bea.com (Switch-3.3.0/Switch-3.2.7) with ESMTP id l94Kgk6O027228 for ; Thu, 4 Oct 2007 13:42:46 -0700 Received: from repbex01.amer.bea.com (repbex01.bea.com [10.160.26.98]) by repmmr02.bea.com (Switch-3.3.0/Switch-3.2.7) with ESMTP id l94Kgiwn022977 for ; Thu, 4 Oct 2007 13:42:44 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: RE: Cloning Calendar proxies Date: Thu, 4 Oct 2007 13:42:36 -0700 Message-ID: <3992B07C0590B548BB294D31768A1DA2801FCB@repbex01.amer.bea.com> In-Reply-To: <002601c806c5$3f01b6a0$0500a8c0@kokako> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Cloning Calendar proxies Thread-Index: AcgGwgLF6O1gag1qSsuakB1Oyy3kDAAAzFBQAABk1CA= References: <89c0c52c0710041300x484c3efbha010516451e5ee2a@mail.gmail.com> <002601c806c5$3f01b6a0$0500a8c0@kokako> From: "Pinaki Poddar" To: x-BEA-PMX-Instructions: AV x-BEA-MM: Internal-To-External X-Virus-Checked: Checked by ClamAV on apache.org One of the reasons of these objects being proxied is that their change can mark the owning persistent entity as dirty. Pinaki Poddar 972.834.2865 >-----Original Message----- >From: Evan Ireland [mailto:eireland@sybase.com] >Sent: Thursday, October 04, 2007 3:29 PM >To: dev@openjpa.apache.org >Subject: RE: Cloning Calendar proxies > >Just curious, why are Calendar objects being proxied in the >first place? > >> -----Original Message----- >> From: Kevin Sutter [mailto:kwsutter@gmail.com] >> Sent: Friday, 5 October 2007 9:01 a.m. >> To: dev@openjpa.apache.org >> Subject: Cloning Calendar proxies >> >> Hi, >> It seems that the IBM JDK is cloning a Calendar object when >performing >> the >> .equals() method. If I call .equals() on one of our Calendar proxy >> objects, the underlying implementation seems to be cloning >the object >> before determining the equality. While using this cloned >object, one >> of the setter methods is called. Since this is a cloned Calendar >> proxy, we do some processing to access the associated StateManager. >> But, that requires access to a Broker and there is no Broker >instance >> associated with this cloned object and we end up throwing an >> IllegalStateException. Due to that exception, the .equals() always >> returns false. >> >> So, before I start experimenting with various fix strategies, I'm >> looking for some guidance from the original developers... >> >> o Should we override the clone() method? And, if we do, >should we be >> returning a non-proxy version of a Calendar object? Or, should we >> ensure that a fully populated Calendar proxy object get returned? >> >> o Or, should we think about overriding the .equals method on the >> Calendar proxies? I'm not too thrilled with this since then >we'll be >> attempting to implement the javadoc for these object types. >> >> Whatever we determine will probably apply to all of our proxy object >> types, even though we're only hitting this problem with the Calendar >> proxy due to the IBM JDK. >> >> Thoughts or suggestions? >> Kevin >> > > Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.