In my application I keep a LINQ object fetched from the database, and regularly modifies it followed by db.SubmitChanges()
.
I have read that you are not supposed to keep around the DataContext
object for a long time.
But if I close my DataContext
between modifications, I guess the data object loses its link to the actual database row.
What is the best alternative to keeping the DataContext open? Do I really have to reload the row every time I want to update it?