Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 19146 invoked from network); 8 Oct 2007 14:53:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Oct 2007 14:53:51 -0000 Received: (qmail 91477 invoked by uid 500); 8 Oct 2007 14:53:39 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 91328 invoked by uid 500); 8 Oct 2007 14:53:39 -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 91319 invoked by uid 99); 8 Oct 2007 14:53:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Oct 2007 07:53:39 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Oct 2007 14:53:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8D265714159 for ; Mon, 8 Oct 2007 07:52:50 -0700 (PDT) Message-ID: <23472912.1191855170575.JavaMail.jira@brutus> Date: Mon, 8 Oct 2007 07:52:50 -0700 (PDT) From: "Kevin Sutter (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-396) Cloning Calendar proxies doesn't detach from StateManager In-Reply-To: <13742170.1191852890548.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kevin Sutter updated OPENJPA-396: --------------------------------- Attachment: OPENJPA-396.patch Proposed patch for OpenJPA-396. It was built against the 1.0.x branch, but also seems to work with the trunk (1.1.0). When testing this patch, I found that TestProxyManager had a couple of problems that needed correcting. After these changes were made, I had to re-factor a few of the "assert" methods so that we were testing for proper equality when copying vs cloning. That's why the patch for TestProxyManager looks larger than expected. I plan to commit these changes later today unless concerns are raised with the patch. Thanks, Kevin > Cloning Calendar proxies doesn't detach from StateManager > --------------------------------------------------------- > > Key: OPENJPA-396 > URL: https://issues.apache.org/jira/browse/OPENJPA-396 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Affects Versions: 1.0.0, 1.0.1, 1.1.0 > Reporter: Kevin Sutter > Assignee: Kevin Sutter > Fix For: 1.0.1, 1.1.0 > > Attachments: OPENJPA-396.patch > > > This problem was first discussed on our dev mailing list: http://www.nabble.com/Cloning-Calendar-proxies-tf4571181.html > Per the discussion on that thread, I am proposing to modify the generated proxy code to override the clone() method. This clone() method will do the necessary copying of data from the original object, but then also null out the sm (StateManager) and zero out the field attributes. This action detaches the cloned object from the StateManager (and associated EntityManager). > Instead of limiting this action to the Calendar proxy, I am adding the clone() method implementation to all of our proxy objects that we generate. Granted, some of the object types do not directly support the clone() method, but that will be detected when or if anybody attempts to use the clone() method on these types (compiler generated error message). > I'll be posting a patch shortly and I plan to commit the changes later today (unless there is opposition). > Thanks, > Kevin -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.