Re: Fast tree scan

2006-06-01 Thread Mike Schrag
What it comes down to is that hierarchical/graph-style data structures are REALLY hard to do depth queries on with SQL ... Oracle provides the "connect by" syntax that makes certain special cases easier (but has huge restrictions), and getting that to play nicely with EO probably would be a

Re: Fast tree scan

2006-06-01 Thread Florijan Stamenkovic
Flor, Two things spring to mind. The first is to just have the entity cached in RAM via the setting in EOModeler. Select the entity, inspect it, and go to the advanced entity inspector (the second icon), and select the checkbox at the bottom that says, "Cache in Memory". This will pull in

Re: Fast tree scan

2006-05-31 Thread Mike Schrag
Re: entity caching, you might want to take a look at this: http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/ Caching_and_Freshness#EOEntity.27s_Cache-In-Memory_Setting before turning on entity caching (or rather, before deploying it at least :) ). Just has some caveats, etc

Re: Fast tree scan

2006-05-31 Thread Paul Suh
Flor, Two things spring to mind. The first is to just have the entity cached in RAM via the setting in EOModeler. Select the entity, inspect it, and go to the advanced entity inspector (the second icon), and select the checkbox at the bottom that says, "Cache in Memory". This will pull in

Re: Fast tree scan

2006-05-31 Thread Sam Barnum
Arr, and don't forget to set the last batch once the loop is closed. On May 31, 2006, at 8:47 AM, Sam Barnum wrote: The solution is to fetch all objects with a single fetch, then populate the "child" relationships for records from the bottom up, by examining the to-one parent relationship o

Re: Fast tree scan

2006-05-31 Thread Sam Barnum
I should also mention, I'm not sure if this will cause all the EOs to be flagged as modified, it probably will. I used this technique in a throwaway editing context which I never called saveChanges() on. There might be a better way to populate the to-many relationships without having it b

Re: Fast tree scan

2006-05-31 Thread Sam Barnum
The solution is to fetch all objects with a single fetch, then populate the "child" relationships for records from the bottom up, by examining the to-one parent relationship of each EO. Since it's a to- one relationship, the faults will pull from the cache, and since you've fetched all EOs,

Fast tree scan

2006-05-31 Thread Florijan Stamenkovic
Hi all, I have an entity that relates to itself, having a parent and children of the same entity. It works fine. The intention is that the tree can be used to indefinite depth, with an indefinite amount of branches. Practically, this measures let's say ten levels of depth, and involved h