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?
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.
精彩评论