Print Page | Close Window

Eager Load Weird Issue

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3999
Printed Date: 07-Sep-2025 at 7:06am


Topic: Eager Load Weird Issue
Posted By: Vonzkie
Subject: Eager Load Weird Issue
Date Posted: 21-Feb-2013 at 1:15am
Hi,

Do you have a known issue on Eager Load not working on Code First 6.1.9.0 in some cases?
We have a Windows Form Application and upon launching of the first form, we have a query that includes other related tables. On one of our servers, when we do a sql server profile, the query is executed one by one, just like how lazy loading does.. but to all of our servers it inner joins it and everything is working fine.
Btw, we are connecting to that server via internet, but we also have other servers that we connect via internet but this issue doesn't happen. The BOS Application used is the same to all of our servers.

I'm reporting this because it is an impediment in our part.
What happened is that other forms in our application doesn't show data maybe because the execution of the first query is not yet finished. Our first query is a medium size query that includes related tables (supposedly).
The average query time is 1-2 seconds, but on one of our servers, since it does a weird lazy loading, it tooks around 3-5 minutes to finished.

Thanks,
Von





Replies:
Posted By: kimj
Date Posted: 21-Feb-2013 at 7:40am
We haven't seen this issue before.
 
DevForce will convert the EntityQuery with the Include statements into the corresponding EF ObjectQuery, and allow EF to execute it.  EF uses an ADO.NET data provider to convert the query into SQL appropriate for the database.   We haven't seen multiple SQL queries produced from a single EF query, but it's possible that either the data provider, or the database execution plan, is causing this.   I'd first check the provider version on the server in question, and also the EntityFramework.dll version, and anything else that might differ on this one server.


Posted By: Vonzkie
Date Posted: 21-Feb-2013 at 11:33pm
Hi,

The version of our EF is 4.3.1, the edition of our SQL is Standard but right now it's working but we didn't do something on it.. I'm not sure what causes it and when it happens again, we don't know what to check or configure.. Please let us know on your investigation so that we will have a workaround when it happened again.

Thanks,
Von


Posted By: kimj
Date Posted: 22-Feb-2013 at 8:31am
Von, we're not investigating this further.  It's not something we've seen, and it's also not caused by DevForce.  If I were you I'd carefully look at the OS/IIS/SQL configurations on the different servers, and maybe post to StackOverflow or the http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/threads - EF forum to see if anyone has seen the problem. 


Posted By: Vonzkie
Date Posted: 26-Feb-2013 at 1:36am
Hmmm, is it possible that you have an exception to the rule based on different scenario on OS/IIS/SQL/Memory/Threads that let's your framework convert the supposedly Eagerloaded ObjectQuery into a Lazy Loaded Object Query?

Thanks,
Von 


Posted By: kimj
Date Posted: 26-Feb-2013 at 9:24am
No, the logic for ObjectQuery construction is not that sophisticated.   An error during query construction could prevent the Include methods from being processed, so check your server-side debug log for anything unusual there.



Print Page | Close Window