LinqPad getting stuck after updating a few thousand records.
Yesterday, I ran this query:
Here is a screenshot:
Any help on why my query is randomly stopping yet still saying "Executing" after only updating a few thousand records would be greatly appreciated.
PS: One more thing I tried was moving the "SubmitChanges" method outside the outer foreach loop but to no success.
var serverQ = from a in Import2s select a; foreach (var a in serverQ) { var col = a.TempCol; var split = col.Split('\\'); foreach (var s in split) { if (s.Contains(',')) { a.TempCol = s; SubmitChanges(); } } }It ran up until row ~4700 then stopped generating code. I ran it again and left it overnight at work, and that time it ran until record ~37000. It is stuck on declaring the SQL variables for some reason, but I can see the query has been running for 16 hours without any change.
Here is a screenshot:
Any help on why my query is randomly stopping yet still saying "Executing" after only updating a few thousand records would be greatly appreciated.
PS: One more thing I tried was moving the "SubmitChanges" method outside the outer foreach loop but to no success.
Comments
If it possible to do this as a single SQL update, you'd be better off doing so because you'd avoid the round-tripping and memory consumption.
The query just terminated with the error "InvalidOperationException: This SqlTransaction has completed; it is no longer usable."
I also see that the query ran for 20 hours but only performed ~30k updates as per the screenshot in my OP.
An alternative would be to retrieve your data in bit-size chunks and create a new Dataconnection for each chunk. This would be mean that the changeset would not keep growing and growing, eg