This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Eager loading with one-to-one associations does not always set EntityHolder.IsLazy to false. As a result, Lightspeed attemps to load an associated entity again. It only happens when the associated entity does not exist in the database. I created a Sample Project. It has two entities Fruit and FruitMeta with one-to-one association. When I create a Fruit without FruitMeta and try to load it with eager-loaded FruitMeta, it make an addition query in order to get FruitMeta. No other call should be made because the FruitMeta is loaded eagerly. IsLazy is set to true on the EntityHolder (supposed to be false). This is what I found debugging the source code: EntityLoader successfully sets IsLazy to false in the MarkEagerLoadsAsNonLazy method. However, IsLazy property still returns true because IsCollectionProxy is true and ProxiedCollection.IsLazy is false:
Expected result: There should be no attempt to get FruitMeta if it's already loaded eagerly. |
|