Re: Strange localInstanceOfObject behaviour...
Re: Strange localInstanceOfObject behaviour...
- Subject: Re: Strange localInstanceOfObject behaviour...
- From: Mike Schrag <email@hidden>
- Date: Wed, 31 May 2006 22:22:18 -0400
Good point -- Thanks for the correction. I should have prefixed with
"in the general case" rather than the bare "you can't" :) I almost
always end up using independent peer editing contexts and as a result
I don't even consider that as an option.
ms
On May 31, 2006, at 6:01 PM, Mark Ritchie wrote:
On Wednesday, May 31, 2006, at 05:37PM, Mike Schrag
<email@hidden> wrote:
You can't localInstanceOfObject a new object (one that has not
been committed yet). There's no snapshot yet, so it would have
odd side-effects if they allowed you to do so (it would mean that
when you save both editing contexts, it would commit twice, i
would assume). Not sure if old versions of EOF let you, but it's
been this way for a while.
Um, sure you can... As long as the temporary object is registered
in a parent editingContext and your referencing it in a child
editingContext. It just works. This is the beauty of using a
child editingContext to play in, as your 'sandbox' if you like. You
can try out new object connections, configurations and settings
before deciding weather to commit the changes to the parent
editingContext. and then if your happy, you can commit the parent
editingContext to save the whole thing or ditch the parent if you
decide that it's not working out. You'd loose a lot of EOF's
abilities if this wasn't the case.
And just for fun, you can have multiple peer editingContexts which
all reference the temporary EO so long as the temporary object is
registered in an editingContext which is common to both peers. :-)
And yes, IIRC, this has worked back to EOF v2. I've tried to
forget EOF v1 and DBKit! ;-)
Regards,
Mark
__
Mark Ritchie
Diamond Lake Consulting Inc., Toronto Ontario Canada.
_______________________________________________
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