RinatMegenbaev
RinatMegenbaev

Reputation: 31

EntityFramework. OutOfMemoryException

I have objects graph approximately ~80K records.

When I call SaveChanges I have an OutOfMemoryException. I've been reading about separating saveChanges in batches, but I've don't know how to do it. The trouble that I have in the context chanegd data from 7 tables and there is no straight hierarchy.

How to solve the issue?

Upvotes: 0

Views: 247

Answers (1)

Tom Squires
Tom Squires

Reputation: 9286

My advice would be to use a stored procedure. You could try breaking up your data into groups and and changing each individually but it will be inelegant and prone to bugs. Stored procedures will also be much faster which could have a significant affect considering you are using a large dataset.

Upvotes: 1

Related Questions