On Jun 1, 2006, at 2:35 AM, Adam Czysciak wrote:
Hi everyone!
Lately I discovered this Wiki article on EO objects freshness.
http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/
Caching_and_Freshness#Recommended
Previously I've been synchronizing objects with EOF delegate -
whenever object changes (new/updated/deleted), I do invalidate its
GID in all of my registered coordinators. The good point is that I
can control which entities and which actions need to be
synchronized. But - this technique of course may cause EOF locks.
For me it looks that setting default lifetime for objects *may*
improve the process, however in some cases it will cause useless
fetches.
What is your experience guys? Is setting the default fetch
timestamp lag recommended? If so, what value do you recommend? (I
know, this is really app specific...)
I've never had good luck with the object timestamp thing. What
ends up happening is any object you cached gets arbitrarily refetched
when you least expect it.
Instead, what we do is all of our servers run something called
spread. (http://www.spread.org) That basically gives us a robust
broadcast messaging system so that we can publish messages to all the
servers.
We then use a category on EOEditingContext to add a method called
"saveChangesAndNotify". We use this method anytime we want to
broadcast that an object has changed. This calls processRecentChanges
to get a list of the changed objects, then broadcasts the GIDs on the
invalidate channel. Processes that care connect to the invalidate
channel on their local spread daemon and invalidate the GID (which
invalidates it in all the local ecs. )
It's simple, it works, and its not very application specific
because you can selectively choose where to call saveChanges() and
where to call saveChangesAndNotify(). You can even make sure that the
parent relationships get refetched by adding the GID of the parent to
the broadcast as needed; something the fetch timestamp may not do.
Pierce
WOTip: WebObjects will be more then happy enough to pass along any
id='blah' setting you put in the .wod file for use with Javascript
and the DOM.
More Tips: http://www.twinforces.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to archive@mail-archive.com