cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <>
Subject Re: Batch fetching relationships
Date Sat, 16 Aug 2014 00:26:20 GMT
On 15/08/2014 10:24am, Lon Varscsak wrote:
> So, I'm working on porting some things over from EOF/WO/WOnder to Cayenne
> and want to understand what my options are for batch fetching
> relationships.  I understand prefetching, but we have SO many places where
> we don't prefetch (let's pretend for a valid reason :D) and we have an
> array of CayenneDataObjects and we know we're going to access the "x"
> relationship on all of those items.  In WOnder we had an
> ERXBatchFetchUtilites class that would take an EO or an array of EOs and
> then specify one or more key paths which would then trigger batched fetches
> of the given relationships.
> Is this something that's available in Cayenne?

You could subclass the CayenneContext and add your own logic in there to automatically add
some prefetches before you call super.performQuery().

However, you may want to decide whether all those prefetches are really needed. With query
and object caches in Cayenne, you may find that you don't get that much performance benefit,
even if you miss a cache and have to lazily load the relationships. I don't remember EOF well
enough now (it was about 8 years ago I last used it) but was did it have a caching mechanism?

What ever became of EOF/WO? Is it still kicking around somewhere with Project Wonder reverse
engineering the WO code in order to fix bugs and add features? WOlips was a great model editing


Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

View raw message