Re: Practical EditingContext Design Question
Re: Practical EditingContext Design Question
- Subject: Re: Practical EditingContext Design Question
- From: Chuck Hill <email@hidden>
- Date: Thu, 16 Feb 2006 08:30:13 -0800
Hi,
On Feb 16, 2006, at 7:32 AM, Arturo Perez wrote:
email@hidden wrote:
Is it a good solution ?
In the book, different king of EditingContext are explained but
wich one do we need to use for the readers ?
DefaultShareEditingContext ? Other ?
Many thank's for any advice,
Jérémy
That's what the DefaultSharedEditingContext is for (many readers,
few writers)
No. While the EOSharedEditingContext is, technically, instanceof
EOEditingContext it is _not_ a proper editing context and should not
be used as one. You will run into trouble doing that. It is a
shared, read-mostly, object store. Someone at Apple got a little
lazy and did implementation inheritance instead of holding a
reference to an EC or something similar.
but most people have trouble implementing it properly. That may or
may not be because it's buggy.
I'm told ;-) that as of 5.2.4 it is no longer buggy _provided_ that
you use it appropriately (e.g. not as an editing context). I've not
verified this.
What you can do instead is have an application-level editing
context and set your session's defaultEditingContext to that. Then
when a writer comes
in you don't set it.
I wouldn't want to do that...
Of course, you'll have to make sure that you do multithreading and
locking properly in either case.
Locking the shared EC on your own (or having session lock it as the
default editing context) is a risky proposition. Risking deadlock,
IIRC.
Chuck
--
Coming in 2006 - an introduction to web applications using WebObjects
and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
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