• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SharedEditingContext Write Locks?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SharedEditingContext Write Locks?


  • Subject: Re: SharedEditingContext Write Locks?
  • From: Lachlan Deck <email@hidden>
  • Date: Thu, 17 Nov 2005 14:57:35 +1100

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: This email sent to email@hidden
  • Follow-Ups:
    • Re: SharedEditingContext Write Locks?
      • From: Art Isbell <email@hidden>
References: 
 >Re: SharedEditingContext Write Locks? (From: Dov Rosenberg <email@hidden>)

  • Prev by Date: Re: SharedEditingContext Write Locks?
  • Next by Date: Re: SharedEditingContext Write Locks?
  • Previous by thread: Re: SharedEditingContext Write Locks?
  • Next by thread: Re: SharedEditingContext Write Locks?
  • Index(es):
    • Date
    • Thread