New Posts New Posts RSS Feed: Eager Load Weird Issue
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Eager Load Weird Issue

 Post Reply Post Reply
Author
Vonzkie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01-Aug-2011
Location: PH
Posts: 133
Post Options Post Options   Quote Vonzkie Quote  Post ReplyReply Direct Link To This Post Topic: Eager Load Weird Issue
    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




Edited by Vonzkie - 21-Feb-2013 at 1:23am
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Vonzkie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01-Aug-2011
Location: PH
Posts: 133
Post Options Post Options   Quote Vonzkie Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post 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 EF forum to see if anyone has seen the problem. 
Back to Top
Vonzkie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01-Aug-2011
Location: PH
Posts: 133
Post Options Post Options   Quote Vonzkie Quote  Post ReplyReply Direct Link To This Post 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 
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down