I was wondering if the DbContext class is thread safe, I am assuming it’s not, as I am currently executing paralell threads that access the DbContext in my application and I am getting a host of locking exceptions and other things that look like they may be thread related.
Until recently I wasn’t getting any errors…but until recently I wasn’t accessing the DbContext in the threads.
If I am right, what would people suggest as a solution?
It’s not thread safe. Simply create a new instance of
DbContextin you thread.