Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EF Core context to dispose, remove singleton due to connection problems #62

Open
damienbod opened this issue Apr 30, 2019 · 1 comment

Comments

@damienbod
Copy link
Owner

No description provided.

@damienbod 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
@jakakonda
Copy link
Contributor

jakakonda commented Feb 10, 2020

Hello!

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants