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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to