Re: advanced EOF: batch fetching relationship: can't fetch certain relationships
Re: advanced EOF: batch fetching relationship: can't fetch certain relationships
- Subject: Re: advanced EOF: batch fetching relationship: can't fetch certain relationships
- From: Jonathan Rochkind <email@hidden>
- Date: Tue, 17 Feb 2004 20:08:56 -0600
One idea I have:
Construct a fetch spec myself, and do the fetch myself, WITHOUT using
DISTINCT, then asssemble the results into appropriate snapshots, and
record them directly to the EODatabase myself manually.
Doing such low level stuff always makes me nervous, but do the EOF
gurus think something like that will work? Is a good idea?
In investigating the feasibility of this: it appears that for a
flattened many-to-many, a snapshot is only recorded for the actual
flattened relationship---not for the intermediary
(non-class-property) relationship. Which I guess makes sense. Can
someone confirm this is true, and I don't need to worry about storing
snapshots for the intermediary (not class property) relationship?
--Jonathan
At 7:57 PM -0600 2/17/04, Jonathan Rochkind wrote:
Okay, more fun with batchFetchRelationship, trying to optimize some
code. [I have a little bit more insight on the last question after
experimenting; this is a new one].
I have a bunch of objects (call em Departments), with a to-many
relationship (call it toEmployees). (It's actually a flattened
many-to-many, but I don't think that effects the below description).
EOF, in batch fetching a to-many relationship, whether through a
numerical setting in EOModeler, or whether through
EODatabaseContext.batchFetchRelationship.... in either case, it
insists on using a "SELECT DISTINCT" query on the destination
entity. Alas, my database, SQL Server 7, won't allow a "SELECT
DISTINCT" on a table that includes columns of types 'text'. And the
Employee table does.
Prefetching relationship key paths ALSO uses a "SELECT DISTINCT", so
won't work with this relationship either. Whether batch
fetching/faulting, whether prefetching----I can't do it, I get an
exception from my db "Can't select distinct on a table with a 'text'
type column ".
Argh. So... what the heck can I do to efficiently fetch these
to-many arrays? I've got a list of potentially dozens (or even 100
or 200) Departments, and I'm going to have to display them with
their employees. I don't want a seperate trip to the db to resolve
each Departments toEmployees relationship. Can anyone think of any
alternatives at all, anything I can do to solve this problem?
--Jonathan
_______________________________________________
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.
_______________________________________________
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.