3 ms·
Sounds like you disabled lazy loading and that forced everything to be loaded at once. That's a user error, not a EF fault. This is a common theme I've seen wi
by flukus 9y ago
Sounds like you disabled lazy loading and that forced everything to be loaded at once. That's a user error, not a EF fault.
This is a common theme I've seen with people blaming ORM's for being slow, it's the devs not using them appropriately more than the ORM's themselves. Not to say that they don't have their own issues.
- Someone1234 9y agoWith or without lazy loading enabled the result was the same. Generating the structure took seconds and went OOM with enough tables. LazyLoading impacts what data is retrieved from the database (or more to the point when), this is a structural issue before a query was even sent to the database. It would die while generating the query, not sending the query or populating the result. You likely should have asked for more information before concluding it was "user error."
- useerup 9y agoI have been working with EF for years now. It has it quirks - but this is not something that I have ever experienced, nor have I heard of anything like it before today. What I have heard of is traversing the entire graph and causing cascading loading of navigational properties. Yes, I have done that. Something like AutoMapper will do that to you, if you are not careful. Been there and done that. How did you determine that it OOMed while generating the query?
- Someone1234 9y ago> How did you determine that it OOMed while generating the query? By looking at the call stack when the exception was thrown (and the fact that nothing hit the database).
- flukus 9y ago> LazyLoading impacts what data is retrieved from the database (or more to the point when) It impacts more than just that, it will impact the query generation as well. If you have a property that is not lazy loaded then it will attempt to join the relation or load it very another query in the same round trip. Turning it off tells the ORM that every single time you want A it needs to go and get B as well. If you have it off universally it will attempt to load the entire database, or as may be the case here, crashing while trying to generate a query to do so. > You likely should have asked for more information before concluding it was "user error." Perhaps, but you've got multiple conflicting accounts of what went wrong, some comments indicate that it returned data, others say it never touched the database.