Prefetch

Posts   
 
    
Dieter
User
Posts: 1
Joined: 24-Nov-2004
# Posted on: 24-Nov-2004 19:10:49   

I'm experiencing some trouble when i try to prefetch two distinct subpath of a subnode in adapter scenario.

See the following example: Grandparent [id] [name]

Parent [id] [grandparentId] [name]

Child1 [id] [parentId] [name]

Child2 [id] [parentId] [name]

it loads the first subpath only, any cludes?

I'm using the correct code?

IPrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.GrandParentEntity);

prefetchPath.Add(GrandParentEntity.PrefetchPathParent).SubPath.Add(ParentEntity.PrefetchPathChild1);

prefetchPath.Add(GrandParentEntity.PrefetchPathParent).SubPath.Add(ParentEntity.PrefetchPathChild2);

thanks, Dieter.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 24-Nov-2004 20:55:58   

Dieter wrote:

I'm experiencing some trouble when i try to prefetch two distinct subpath of a subnode in adapter scenario.

See the following example: Grandparent [id] [name]

Parent [id] [grandparentId] [name]

Child1 [id] [parentId] [name]

Child2 [id] [parentId] [name]

it loads the first subpath only, any cludes?

I'm using the correct code?

IPrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.GrandParentEntity); prefetchPath.Add(GrandParentEntity.PrefetchPathParent).SubPath.Add(ParentEntity.PrefetchPathChild1); prefetchPath.Add(GrandParentEntity.PrefetchPathParent).SubPath.Add(ParentEntity.PrefetchPathChild2);

You're not using the correct code simple_smile The second prefetchPath.Add(grandparent...) line adds again a node for GrandParentEntity.PrefetchPathParent). What you want is the second subpath node added to the subpath of the first Grandparententity.prefetchpathparent.

So instead do this:


IPrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.GrandParentEntity);
IPrefetchPathElement2 grandParentNode = prefetchPath.Add(GrandParentEntity.PrefetchPathParent);
grandParentNode.SubPath.Add(ParentEntity.PrefetchPathChild1);
grandParentNode.SubPath.Add(ParentEntity.PrefetchPathChild2);

Frans Bouma | Lead developer LLBLGen Pro