Re: EOSharedEditingContext Useful for Read-Mostly?
Re: EOSharedEditingContext Useful for Read-Mostly?
- Subject: Re: EOSharedEditingContext Useful for Read-Mostly?
- From: Art Isbell <email@hidden>
- Date: Mon, 26 Jul 2004 17:45:57 -1000
On Jul 26, 2004, at 2:22 PM, Marek Wawrzyczny wrote:
It shares them. As far as my understanding goes, all objects are
fetched into the EODatabaseContext,
which places snapshots of fetched objects in its EODatabase object.
your own editing contexts, whether they are session, shared peer or
nested ECs all are "children" of the Db EC.
Not sure what you mean by "Db EC" (database editing context?). All
EOEditingContexts are children of an EOObjectStoreCoordinator which has
one or more EOCooperatingObjectStores (usually EODatabaseContexts)
which are mapped to EOModels.
Each time you make changes to an EO, change notification messages are
sent up to the DB EC and then down to all the children.
There are many notifications posted and received by EOF objects.
EOEditingContext broadcasts an
ObjectsChangedInEditingContextNotification when changes to an EO are
made. I believe this notification is intended for objects responsible
for displaying EO values in a UI. Other notifications are broadcast
when an EO is saved to its parent object store. These notifications
are eventually received by all other editing contexts so they can
update the same EO if it's present in these other editing contexts.
What's happening under EOF's covers is very complex and clever.
On 27/07/2004, at 09:25, Hunter Hillegas wrote:
There are about 50 hotels. When using the session context, are they
refetched each time or does EOF share the cache between session
editing contexts? I am trying to minimize DB roundtrips.
If you explicitly fetch these hotels in your Session object, they will
be refetched from the database regardless whether they've been fetched
and cached previously. This ensures any new hotels added to the DB by
another process will be fetched. Fetching these hotels into a shared
editing context maintained by the Application object is a good way to
minimize DB accesses at the expense of data freshness should another
process add or delete hotel objects from the DB. You can schedule the
WO instances to restart after the DB has been refreshed by the cron
job.
Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.