Re: Shared vs regular editing contexts
Re: Shared vs regular editing contexts
- Subject: Re: Shared vs regular editing contexts
- From: Arturo Pérez <email@hidden>
- Date: Tue, 10 Feb 2004 04:24:47 -0500
On Feb 9, 2004, at 10:19 PM, Sam Barnum wrote:
Somewhat trickier is getting inserted records to show up in the shared
EC. You need to add the record (using a non-shared editing context),
then reload the objects in the shared editing context by calling
EOSharedEditingContext.bindObjectsWithFetchSpecification(). There
seems to be a bug where you can't use a named EOFetchSpecification
(from the EOModel file) but must create one programatically.
This seems to be the problem I'm having. There's one part of my app
that creates objects and traversals from that page cause a nasty
exception about sharing blah-blah (reminds me of the old windows "A
Sharing violation has occurred..." :-). Problem is I don't necessarily
know what objects have been added so I don't think the bindObjects
would work. I'll have to look into it.
Would refaulting or invalidating have an equivalent effect? Can I just
refault as invalidating seems
very expensive.
...
Having said all this, it is often easier to just use a regular
EOEditingContext. Chances are, using the shared EC is a premature
optimization. Easy enough to do it later, first just make it work.
Well the session's defaultEditing context is a shared one by default,
isn't it? So it's not like I'm going
out of my way to use it :-)
----
WO in philadelphia - wanna cheesesteak with that?
Please visit webobjects.meetup.com.
_______________________________________________
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.