Re: Prefetching across models/databases
Re: Prefetching across models/databases
- Subject: Re: Prefetching across models/databases
- From: Chuck Hill <email@hidden>
- Date: Mon, 10 Sep 2007 10:01:03 -0700
Hi Travis,
On Sep 10, 2007, at 9:44 AM, Travis Britt wrote:
Having some trouble with prefetching a relationship whose
destination is in another database. (Both databases are Oracle 9.)
SQL is not generated to fetch the destination EOs from the second
database, nor are they faulted in when I try to access them after
the fetch. (I assume b/c EOF thinks they weren't in the database --
if I remove the prefetch on that relationship, they get faulted in
as you'd expect.)
That sounds like an odd result.
Is EOF supposed to handle prefetching across databases, or do I ask
too much of it? Or is it an EOF/Oracle thing...
There are a few situations in which pre-fetching does not "do the the
right thing". This may well be one of them.
Currently I work around this by creating a second fetch spec for
the relationship and fetching the destination EOs with that.
An easy way to do this is to use ERXRecursiveBatchFetching:
NSArray objects = ec().objectsWithFetchSpecification(fetchSpec);
ERXRecursiveBatchFetching.batchFetch(objects,
prefetchingRelationshipKeyPaths(), true);
This is no less efficient and, so far, always does the right thing
for me.
Chuck
--
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