Re: Nested EOEditingContext Question
Re: Nested EOEditingContext Question
- Subject: Re: Nested EOEditingContext Question
- From: Johann Werner <email@hidden>
- Date: Sat, 5 Sep 2009 12:47:47 +0200
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