Closed wsiscool closed 3 years ago
如题,场景是在队列消费时,因为同时会有多个消费异步执行,但是看IShardingDbAccessor容器注入的是作用域,导致了并行执行时会抛出异常导致消费失败,异常信息:This MySqlConnection is already in use,能否将IShardingDbAccessor的注入方式以配置的形式开放出来
自己创建scope啊
IShardingDbAccessord的实现ShardingDbAccessor我看是internal,没办法自己创建
问题已解决,理解错意思了,Coldairarrow 所说的自己创建scope的意思是,使用IServiceScopeFactory来CreateScope,使得自定义的作用域内都是独立的,就解决这个问题
是的
如题,场景是在队列消费时,因为同时会有多个消费异步执行,但是看IShardingDbAccessor容器注入的是作用域,导致了并行执行时会抛出异常导致消费失败,异常信息:This MySqlConnection is already in use,能否将IShardingDbAccessor的注入方式以配置的形式开放出来