X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) X-Junk-Score: 0 [] X-KAS-Score: 0 [] From: "OCsite" Received: from smtp-beta-1.zoner.com ([217.198.120.62] verified) by post.selbstdenker.com (CommuniGate Pro SMTP 6.3.3) with ESMTPS id 26610213 for webobjects-dev@wocommunity.org; Fri, 15 Oct 2021 15:30:44 +0200 Received-SPF: none receiver=post.selbstdenker.com; client-ip=217.198.120.62; envelope-from=ocs@ocs.cz Received: from smtp.zoner.com (smtp.zoner.com [217.198.120.6]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-beta-1.zoner.com (Postfix) with ESMTPS id EE9621800705 for ; Fri, 15 Oct 2021 15:30:23 +0200 (CEST) Received: from smtpclient.apple (unknown [46.167.220.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ocs@ocs.cz) by smtp.zoner.com (Postfix) with ESMTPSA id C48FB3000076 for ; Fri, 15 Oct 2021 15:30:23 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: [WO-DEV] localinstance for not-yet-saved EOs? Date: Fri, 15 Oct 2021 15:30:22 +0200 References: To: WebObjects & WOnder Development In-Reply-To: Message-Id: <4C071BED-7D77-4DB2-BBC4-2776CB8185B5@ocs.cz> X-Mailer: Apple Mail (2.3654.100.0.2.22) Markus, does this approach properly work for you with saved EOs? Weird; I was = pretty sure localinstance would not copy down to the new EO the local = changes, IIRC, the new EO in the new EC is simply a GID-based fault, to = be, upon using, just re-constructed from the snapshot (which is the = reason you can't do that with a new EO which does not have one), and = that's that. Thus, unless I'm much mistaken, // presumed the saved eo.foo=3D=3D'old' eo.foo=3D'new' assert eo.localInstanceIn(anotherEC).foo=3D=3D'old' All the best, OC > On 15. 10. 2021, at 14:48, Markus Ruggiero (rucotec) = wrote: >=20 > LocalInstance is only allowed for EOs that have already been saved. If = isNewObject() return true then any form of localinstance call returns an = exception. Why? And how can I overcome this? >=20 > I have the following scenario:=20 >=20 > The user picks existing EOs to be worked on at a later point in time. = They can also create on-the-fly new EOs for picking. All EOs as well as = the new ones are associated with the current editing context. The whole = list of picked objects (NSArray containing existing and new EOs) is then = passed to the next page and on to the next. In each step some of the EOs = are modified in various ways until about 3 steps down the line a final = saveChanges() is done. All fine so far.=20 >=20 > But on each step the user can go back up one step (either browser back = button or with a dedicated navigation button on the page). The page = cache takes care of this but the EOs themselves are not in the page = cache and remain modified in their EC. Coming back the previous / first = page does not show the initial state anymore. Ok, easy to solve = (methinks): map the EOs into a new editing context right before going to = the next step. Coming back then automatically throws away that EC. Going = forward again will create a brand new EC. But! localInstancing into the = new EC only works for saved EOs. How do I get these new EOs into the = nextPhaseEC? The new EOs are fairly complex and already have = relationships to other EOs. How can I re-wire the new EOs? >=20 > Thanks for any help > ---markus--- >=20