Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SharedEditingContext Write Locks?



Hi there,

On 17/11/2005, at 2:11 PM, Dov Rosenberg wrote:

We changed the code to do something like this instead:

    fetchedRecords = ec.objectsWithFetchSpecification(fetchSpec);

Where ec is our SharedEditingContext. Is that the correct usage?

Well you only want to do this when there's a need to refresh the data in the shared ec. The two scenarios are:
- upon application launch
- when you've inserted/saved some new objects (via a non-shared ec) that need to be shared.


Objects that are already known by the sharedEC (if deleted/updated) will automatically be picked up by the sharedEc via notifications.

So the general usage other than that is...
- sharedEC.objectsByEntityName()
- sharedEC.objectsByEntityNameAndFetchSpecificationName()

...depending on which method you used to fetch the objects into the sharedEC and/or your particular usage.

Is it safe to assume that if the SharedEditingContext does not contain the
data it will retrieve it. And if it does contain the data that it will use
it instead of re-fetching from the DB?

No. See above...

What is the purpose of the "Share all objects" checkboxes in the EOEntity in
EOModeler? Is it related to the "Cache objects" check box? Does EOF fetch
these things into the SharedEditingContext automatically?

This might be a surprise (given some of Apple's docs) but the WebObjects EOModeler User Guide describes these quite well.
http://developer.apple.com/documentation/WebObjects/UsingEOModeler/ index.html


We have a bunch of data that is static (lookup codes, etc) that are used in
relationships to other EOs that are not static. Can we fetch the lookupCodes
into the SharedEditingContext and make use of them in the regular editing
contexts?

localEC.setSharedEditingContext(null); EOUtilities.localInstancesOfObjects(sharedEC, "Entity"); // i.e., do not make changes to shared objects (and their relatives) // without doing so in a non-shared EC.

Thanks again for all of your help. Hopefully other people have learned as
much as we have.

It's certainly helpful to understand the ins/outs in more detail...

with regards,
--

Lachlan Deck


_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: SharedEditingContext Write Locks? (From: Dov Rosenberg <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.