Re: Nested Editing Contexts
Re: Nested Editing Contexts
- Subject: Re: Nested Editing Contexts
- From: Guido Neitzer <email@hidden>
- Date: Wed, 30 May 2007 14:01:55 -0600
On 30.05.2007, at 13:03, Steven Mark McCraw wrote:
You have stumbled upon what I believe to be one of the biggest
weaknesses in EOF, and the solutions are (again, in my opinion)
terrible.
Hmmm. Interesting opinion. I always see the concept of
"sandboxes" (editingContexts) as one of the big advantages of EOF. It
keeps track of the object graph.
As you've noticed, if you insert things into an editing context as
they are created, you end up with a bunch of uninitialized objects
in the database.
You do only if you don't use it properly. You don't save an
editingContext with stuff you don't want to have in the database -
that is why you don't use the defaultEditingContext for that. It's
the same that you wouldn't commit a database transaction with stuff
you don't want to have in there.
If you use an editing context other than the session's default
editing context, I believe you have to explicitly lock and unlock
it before and after any messages to the ec or changes to the state
of the objects it contains.
Yes, that is correct. You have to lock everything but the
defaultEditingContext.
But I agree with you, that Apple should make that clearer in the
documentation. Even the examples and things like "out of the box
DirectToWeb" uses the defaultEditingContext and that is the main
problem here. If the would introduce the editingContext concept
properly most people won't have these crappy experiences.
cug
_______________________________________________
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