Prefetch path and context

Posts   
 
    
wvnoort
User
Posts: 96
Joined: 06-Jan-2005
# Posted on: 01-Jul-2005 14:33:22   

The LLBLGen Reference manual states the following:

The context to add the entity to if the fetch was succesful, and before the prefetch path is fetched. This ensures that the prefetch path is fetched using the context specified and will re-use already loaded entity objects.

Does this mean that entities that are part of the prefetch path will be fetched using the context, or only the root-entity?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 01-Jul-2005 20:48:40   

All of them. They're added to the context if they're not there, or replaced by the entity instances already in the context (and these instances then get the new field values of course).

Frans Bouma | Lead developer LLBLGen Pro
wvnoort
User
Posts: 96
Joined: 06-Jan-2005
# Posted on: 04-Jul-2005 09:05:46   

Thanks, i am beginning to understand how to use the context.

I should have looked further in the first place, because it seems i cannot use the context for the problem at hand. I noticed, and your response confirms that, the fields of the entity are reset after a second fetch. But that is not what i want. I want to have the entity to retain it's values from the first fetch.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 04-Jul-2005 10:26:10   

They're set to the values of the entity in the db, which normally are the values in the entity. If you want to 'fetch additional data along the way during the process', it might not work indeed, which could be solved by rescheduling the fetches so you get a process sequence which comes down to: fetch data -> process data -> update db entities with results, which is more scalable.

Frans Bouma | Lead developer LLBLGen Pro