Re: SharedEditingContext Write Locks?
Re: SharedEditingContext Write Locks?
- Subject: Re: SharedEditingContext Write Locks?
- From: Ben Trumbull <email@hidden>
- Date: Thu, 17 Nov 2005 11:46:52 -0800
At 10:36 PM -0500 11/16/05, Dov Rosenberg wrote:
If I want to use shared objects from a non shared editing context I need to
set the shared ec
SharedEc = EOSharedEditingContext.defaultSharedEditingContext();
EOEditingContext ec = new EOEditingContext ();
ec.setSharedEditingContext(SharedEc);
By setting the Shared EditingContext into my regular one, do I now get
automatic access to the shared objects stored within?
Yes. This is the primary working pattern for shared objects.
So if I do something like
ec.objectsWithFetchSpecification(....)
And the objects had been previously retrieved by the SharedEC - would ec be
able to use them?
Yes. This is the pattern I recommend.
The shared objects will be pointer equal, no matter how many regular
ECs are using them. Setting the regular EC's shared context to null
allows you to fetch and change different working copies of the EOs,
just as EOF works with regular ECs.
If you encounter problems using shared ECs, especially deadlocks and
such, please file bugs with bugreport.apple.com. As I mentioned, to
the best of my knowledge, all known deadlocking bugs in EOF have been
addressed.
--
-Ben
_______________________________________________
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