Coldairarrow / EFCore.Sharding

Database Sharding For EFCore
Apache License 2.0
693 stars 143 forks source link

IDbAccessor 设置为线程安全 #100

Closed shenglingshi closed 3 years ago

shenglingshi commented 3 years ago

在多线程共用 IDbAccessor 时会有异常,可否调整内部DbContext实例化的方式 。 A second operation was started on this context before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.

Coldairarrow commented 3 years ago

多线程自行创建scope获取IDbAccessor