Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E3BCE10232 for ; Thu, 5 Sep 2013 17:20:07 +0000 (UTC) Received: (qmail 24373 invoked by uid 500); 5 Sep 2013 17:20:07 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 24117 invoked by uid 500); 5 Sep 2013 17:20:07 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 24108 invoked by uid 99); 5 Sep 2013 17:20:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Sep 2013 17:20:06 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.78.103.231] (HELO vorsha.objectstyle.org) (208.78.103.231) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 05 Sep 2013 17:20:00 +0000 Received: (qmail 31826 invoked from network); 5 Sep 2013 17:25:51 -0000 Received: from unknown (HELO ?192.168.2.104?) (212.98.191.4) by vorsha.objectstyle.org with SMTP; 5 Sep 2013 17:25:51 -0000 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Inserting object on FaultFailure: no matching row ? From: Andrus Adamchik X-Priority: 3 In-Reply-To: <000a01ceaa1b$03e37400$4d07020a@groupeditors.co.za> Date: Thu, 5 Sep 2013 20:19:37 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <000a01ceaa1b$03e37400$4d07020a@groupeditors.co.za> To: user@cayenne.apache.org X-Mailer: Apple Mail (2.1508) X-Virus-Checked: Checked by ClamAV on apache.org IMO creating a new object and initializing it afresh is the way to go.=20= Andrus On Sep 5, 2013, at 12:33 PM, Jurgen wrote: > If a user tries to commit an object that has been deleted in the DB = (by another user) then cayenne throws an exception. >=20 > If the desired recovery mode is that the object be inserted back into = the DB, how would one instruct Cayenne to do so now ? >=20 > I suppose setPersistanceState( NEW ) is not going to work ? >=20 > Should I then make a newObject and copy all the fields across or is = there a "simpler more elegant" way ? >=20 > Thanks. > = ##########################################################################= ########### > DISCLAIMER:=20 > The information contained in this e-mail is the property of CTP Ltd = and/or its associate companies and is confidential and intended for the = addressee only.=20 > If you are not the addressee and receive this e-mail by mistake, = please notify the sender and delete this email immediately as any = disclosure, copying,=20 > distribution or use thereof may give rise to a claim against you.=20 > The sender and/or the CTP Group accept no liability for any damages = caused by this email by interception, interference, error, virus or = other cause.=20 > Views and opinions expressed in this email are those of the sender = unless clearly stated to be those of a company in the CTP Group.=20 > The Company reserves the right to lawfully monitor e-mails. >=20 > = ##########################################################################= ###########