Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Collection property access causes lazy loading on new entity
 

Pages: 1
LLBLGen Pro Runtime Framework
Collection property access causes lazy loading on new entity
Page:1/1 

  Print all messages in this thread  
Poster Message
ww
User



Location:

Joined on:
01-Oct-2004 22:58:25
Posted:
65 posts
# Posted on: 06-Dec-2018 17:55:28.  
Version 5.4, Self-Servicing.

Say I have entities Master and Detail, with a 1:M relationship. In MasterEntity, there's a Details property that returns the collection of related DetailEntities. With lazy loading enabled, this collection is fetched from the database the first time I access the Details property.

However, I've noticed that this happens even if the MasterEntity is new, even though there couldn't be any existing Details in the database (because of the FK restriction). When I'm adding a large number of MasterEntities, this produces a correspondingly-large number of unnecessary database calls.

Is there a way to avoid this, short of switching to self-servicing? Will setting AlreadyFetchedDetails do what I want?
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14462 posts
# Posted on: 06-Dec-2018 18:06:01.  
This is by design, as you can the PK-FK can be set to retrieve the related entities.

If this behavior is not what you want, you may want to turn off Lazy Loading.


  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.