You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
damienbod
changed the title
Fix EF Core context to dispose, remove singleton due to conection problems
Fix EF Core context to dispose, remove singleton due to connection problems
Apr 30, 2019
I have a bit of an issue with this task. Namely getting concurrency exceptions.
I've been searching through the code a bit to see if I could help with the task, and from what I could find the blocking occurrences are the following services:
SqlStringLocalizerFactory
DevelopmentSetup
Due to the caching it makes sense to keep them as Singleton. I'd go with changing the DbContext scope to Scoped or Transient and consume it as it in intended in background service (consume IServiceProvider and create a scope, docs).
If (almost) all lock (_context) in the SqlLocalizerFactory are replaced with creating a scope, the issue should be resolved.
Please correct me if I'm wrong and if I missed any case since I'm not using the library to the full extent. If this is it, I could make the necessary changes.
No description provided.
The text was updated successfully, but these errors were encountered: