Re: solved: advanced EOF: batch fetching relationship: can't fetch certain relationships
Re: solved: advanced EOF: batch fetching relationship: can't fetch certain relationships
- Subject: Re: solved: advanced EOF: batch fetching relationship: can't fetch certain relationships
- From: Jonathan Rochkind <email@hidden>
- Date: Wed, 18 Feb 2004 16:03:13 -0600
At 4:55 PM -0500 2/18/04, arturo wrote:
----- Original Message -----
> Thanks to Alexander Spohr for giving me the idea for a solution.
>
> Switch in your own EODatabaseContext delegate right before calling
> batchFetchRelationship. Implement the
> databaseContextShouldFetchObjects delegate method, to take the
> EOFetchSpecification passed in, and turn _off_ "useDistinct". The
> batchFetchRelationship call now works, without SQL "select distinct"!
>
>
Does this affect databases other than MS-SQL? That is, ignoring the
issue about CLOBS.
Well, if you ignore the issue of CLOBs, you are ignoring THE issue
which I was dealing with.
The issue is that some databases won't allow a 'distinct' select
against tables with certain column types. In Oracle, that's 'CLOB'
(and maybe some others), in MS SQL Server 7 that's 'text' (and a
couple others). If such a table is at the destination of your
relationship, you can't batch fetch the relationship using normal
means---because EOF generates a 'select distinct' query for them. The
solution discusssed in my post was one solution.
This issue is of no concern to you if:
* you don't do batch relationship fetching at all [Although this
issue also effects pre-fetching in a fetch spec, my solution is only
to batch relationship fetching, which is a reasonable although not
entirely equivalent alternative].
* you do batch fetching, but your database allows 'select distinct'
against any table at all, containing any column types at all
* your database does prohibit 'select distinct' for some column
types, but you don't use those column types.
* you do use those column types, but not in an entity that is the
destination for a relationship you'd like to batch fetch/batch fault.
On the other hand, if you'd like to batch fetch a relationship, whose
destination is an entity which belongs to a table which your db won't
allow a 'select distinct' query to, then the issue effects you. I am
not an expert on the features of every relational database in
existence (or even the common ones), so I can't tell you which
databases are potentially effected.
--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.