Re: Nested EOEditingContext Question
Re: Nested EOEditingContext Question
- Subject: Re: Nested EOEditingContext Question
- From: "Chan Yeow Heong, Jerome" <email@hidden>
- Date: Sun, 06 Sep 2009 16:29:54 +0800
So what happens after I do
nested.save();
original.save();
Does nested go away? Does it get garbage collected?
What is the editing context of the objects manipulated after both
saves are done? Is it original?
On 05-Sep-2009, at 6:47 PM, Johann Werner wrote:
Hi Jerome,
Am 05.09.2009 um 11:50 schrieb Chan Yeow Heong, Jerome:
When I'm using nested editing contexts, do I need to call revert on
a original editing context when I call revert on the nested context?
EOEditingContext original = ERXEC.newEditingContext(true);
EOEditingContext nested = ERXEC.newEditingContext(original,true);
... do some work ...
... something went wrong and we have to cancel all changes ...
nested.revert();
original.revert(); // <-- Is this second call needed?
No, this call is not needed. A nested editing context behaves as any
other 'normal' editing context with the only difference that saving
the context doesn't push your changes to the db but into the parent
context. So either call revert on your nested context or just
discard the context and replace it by a new one.
jw
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden