Closed pdeffendol closed 7 years ago
You've had to remove transactions? Or just transactions in the filter?
Sorry, I should read through again before submitting - we removed the filter to address the problem. We made sure that our commands, etc., explicitly called SaveChanges(Async) at the end, which wraps up the changes in a BD transaction anyway.
Gotcha. We haven't seen it, but we've also usually had that inside of a MediatR pipeline component, as opposed to the filter.
Hmm, interesting, so something like:
Validation -- > Authorization --> Start transaction --> Command --> Save/Commit?
Something like that, but I gotta be careful about validation, if it his the DB and it's in the transaction then I can get dirty/stale reads.
Thanks for the feedback!
We used the DbContextTransactionFilter in one of our projects (ASP.Net Core 1, EF6, full .Net framework) to ensure that each request was wrapped up in a SQL Server transaction. We had to remove it because SQL Server was killing queries due to deadlocks and causing the app to crash, once the number of users ramped up. (We're talking handfuls of concurrent users, not hundreds.) Is this something anyone has come across before, and is there another way to deal with it other than turning off the per-request transaction?