Re: Do batch faults "cascade" ?
Re: Do batch faults "cascade" ?
- Subject: Re: Do batch faults "cascade" ?
- From: Chuck Hill <email@hidden>
- Date: Thu, 11 May 2006 18:19:31 -0700
On May 11, 2006, at 5:01 PM, Owen McKerrow wrote:
Hi All,
Say I have the following set-up
Person <- ->> PersonName
PersonName <- ->> Publications
And I set the Batch Faulting Batch Size to 10 between Person and
PersonName and set it to 10 between PersonName and Publications
will they both "fire" off when I grab a person ?
No. Neither will fire until you touch (reference) them.
i.e. I search for a user, who has 3 names, each of which has 3
publications associated with it. Will I get back 13 rows ? 1 for
the person, 3 for the names and 9 for the pubs ? Or more precisely
will it grab all of those in 1 SQL statement ? Or would I get ( and
I think this is more probable ) 4 objects, 1 for the person and 3
for their names ?
I think you are confusing prefetchingRelationshipKeyPaths in a fetch
specification and batch faulting. Batch faulting just ensure that
when one fault is fired, others are fired at the same time so that
fewer trips are made to the database.
prefetchingRelationshipKeyPaths is about pulling in all objects
related to the object(s) being fetched. If you fetch the person and
set prefetchingRelationshipKeyPaths to ("personNames",
"personNames.publications") EOF will make three selects. One for
Person, one for all PersonNames for that Person, and one for the
Publications. The fetch will return the single person object.
Chuck
--
Coming in 2006 - an introduction to web applications using WebObjects
and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
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