System.OutOfMemoryException with entity framework?

I don't know what do you mean by refreshing the EF with big tables but the only way to avoid this exception is to make sure you don't load large amount of data into memory or add more memory to your machine.

I mean Model. Refresh(RefreshMode. StoreWins, tablename).

The table has 4919653 rows. The reason to do this is that, this table is updated by sql. This changes are not recognized by EF.

– gmail user Nov 15 '10 at 16:03 please help me. – gmail user Nov 15 '10 at 16:35 I don't know how to help you other than saying: don't load 4919653 rows into memory. – Darin Dimitrov Nov 15 '10 at 16:37 If there any other way to make Entity framework aware of changes made by sql.

– gmail user Nov 15 '10 at 17:26.

Like Darin says the refreshing of the model does not load any of the rows. Since you are refreshing the model in code, I suspect that there may be something in your code that is loading all the rows, or has an infinate loop. You can edit the EF model directly by opening the file and editing the xml.

But you need to be very carefull if you do this.

This is actual story – gmail user Nov 15 '10 at 18:12 I hope I'll explian properly. I've some code that do DB updates. There are 2 parts to it.1.

The EF call the Stored Procedure to update DB. (this is big existing logic. So I can't rewrite in linq) 2.

The EF + linq also does some DB operation in the same method. At some point, it uses the DB changes done by SP. The problem is that, EF can't recognise the changes done by SP.

When EF fetches the data, it still has the old values. How do I refresh the EF? – gmail user Nov 15 '10 at 18:12 You only need to refresh the model if you make a change to the structure of the tables.

– Shiraz Bhaiji Nov 15 '10 at 18:23 how do I get the data changes done by sql, in the model? – gmail user Nov 15 '10 at 18:55 Are you trying to insert rows or change the structure of your tables? – Shiraz Bhaiji Nov 15 '10 at 20:11.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions