OutOFMemoryException when querying entitymodel

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
vthh
Posts: 3
Joined: Mon 15 Dec 2008 16:29

OutOFMemoryException when querying entitymodel

Post by vthh » Mon 15 Dec 2008 16:40

Hi!
I have a EF model with Entities mapped to DB views, and the tables under the views are massive and when I try to query the these entities I get OutOfMemoryException. There must be something possible to fix this.

here is a snippet of the code

Code: Select all

using(ContractEntities ctx = new ContractEntities ())
{
List list = ctx.ContractSet.Where(p => p.SocialSecurityNumber == "1234567890").ToList();
return list;
}

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 16 Dec 2008 12:28

When you work with ORM like Entity Framework you should be ready to the increasing of memory load.
Try to change your code obtaining the list of entities.

vthh
Posts: 3
Joined: Mon 15 Dec 2008 16:29

Post by vthh » Thu 18 Dec 2008 17:28

how so, use more filtering? well I've added more filtering and so far its not helping. This used to work perfectly but suddenly it just stoppes. are there any limitations to the trial version?

vthh
Posts: 3
Joined: Mon 15 Dec 2008 16:29

Post by vthh » Fri 19 Dec 2008 13:42

Found out what it was. I was passing a predicate of type Func to the execution method when instead it was supose to be Expression>. I wanted to use dynamic linq queries and thought that Func was the way to go :oops:

Post Reply