Can't modify EO objects! ARGH! =(
Can't modify EO objects! ARGH! =(
- Subject: Can't modify EO objects! ARGH! =(
- From: Marek Wawrzyczny <email@hidden>
- Date: Tue, 22 Jul 2003 09:36:33 +1000
Thanks for the pointers, I'll have an in-depth look into multi-EC
strategies. Up until now I've simply had no need to use them.
Kind of reinforces the fact that with WO you never stop learning :)
On Tuesday, Jul 22, 2003, at 02:04 Australia/Sydney, Jonathan Rochkind
wrote:
There is an Apple document on using nested EC's to deal with exactly
the sort of thing we are talking about here. My current thinking
matches Chuck's on this though: it's probably better to use peer ECs
rather than nested ECs for this purpose. While the Apple document
reccomends nested ECs (wrongly, in my current opinion), the techniques
and code examples they give generally are right for peer ECs as well.
The only difference is in how you create the EC, naturally. [If you
DO choose to use nested ECs, the Apple document for some reason warns
you against 'doubly' nesting them. In fact, this warning is
unneccesary---you CAN doubly nest ECs, if you really mean to. But you
probably don't really mean to. And again, I think peer rather than
nested ECs are generally the way to go.]
Alas, the document doesn't exist in the current documentation. But
you can find it in the old documentation at:
http://developer.apple.com/documentation/WebObjects/WebObjects_5/
Topics/ProgrammingTopics.39.html
At 10:04 PM 7/20/2003 -0700, Chuck Hill wrote:
I've never tried this for this reason, but... :-) Try calling
ec.processRecentChanges() before calling saveChanges(). That may
avoid the
validation errors. In either case I'd report this as a bug.
You might also want to consider peer (new EOEditingContext()) editing
contexts rather than nested. They are easier to setup and save.
Nested
are usually only worth it if you are doing a multi page progress, IMO.
Chuck
At 01:29 PM 21/07/2003 +1000, Marek Wawrzyczny wrote:
>There is one annoying side effect (at least in WO 5.1) which makes
>
>1) create
>2) insert
>3) populate
>
>rule annoying - when you use the default editing context and have to
>insert then delete newly created objects frequently, prior to calling
>saveChanges().
>
<...>
Marek Wawrzyczny
software engineer
-------------------------->
ish group pty ltd
7 Darghan St Glebe 2037 Australia
phone +61 2 9660 1400 fax +61 2 9660 7400
http www.ish.com.au | email email@hidden
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.