Return-Path: X-Original-To: apmail-cayenne-commits-archive@www.apache.org Delivered-To: apmail-cayenne-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9F8D4FF0B for ; Mon, 15 Apr 2013 11:46:19 +0000 (UTC) Received: (qmail 80547 invoked by uid 500); 15 Apr 2013 11:46:19 -0000 Delivered-To: apmail-cayenne-commits-archive@cayenne.apache.org Received: (qmail 80160 invoked by uid 500); 15 Apr 2013 11:46:17 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 80086 invoked by uid 99); 15 Apr 2013 11:46:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Apr 2013 11:46:16 +0000 Date: Mon, 15 Apr 2013 11:46:16 +0000 (UTC) From: "Andrus Adamchik (JIRA)" To: commits@cayenne.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAY-1807) Replace a Detached object with new one on a relationship throws NPE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAY-1807?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D136316= 66#comment-13631666 ]=20 Andrus Adamchik commented on CAY-1807: -------------------------------------- Thanks for the JIra. May I ask for a few details: 1. Do you have a stack trace? 2. Was the detached object mentioned here NEW before it was deleted? =20 > Replace a Detached object with new one on a relationship throws NPE > -------------------------------------------------------------------- > > Key: CAY-1807 > URL: https://issues.apache.org/jira/browse/CAY-1807 > Project: Cayenne > Issue Type: Improvement > Components: Core Library > Affects Versions: 3.0.1 > Reporter: Manuel S=C3=A1nchez > Priority: Minor > > In the following scenario: > I deleted and persistent object (gets detached) which was used in a relat= ionship > I replaced it with a new one at the end of a relathionship > Cayenne records an ArcDeletedOperation with the detached object involved = and throws a NPE when commiting. > I solved the problem by disconecting the detached object from the relatio= nship (set to null) and then assigning the new one; in two steps > Cayenne could check if its a detached object on that ArcDeletedOperation = and say so instead of throwing a NPE, or not recording any action, .. somet= hing more elegant than a NPE > Thanks -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira