dotnetcore / dotnetcore/FreeSql

通过作用域下,不同Repository的先后查询会抛出The connection does not support MultipleActiveResultSets

Open
#2,160 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.4k
Forks
910
PR merge metrics
No merged PRs in 30d

Description

#### 问题描述及重现代码:
如下图,这是在同个工作单元下,不同Repository都做了查询。连接字符串信息没有声明MultipleActiveResultSet=true.
但是两个查询并不是并行执行。而是先后await的。但还是抛出了The connection does not support MultipleActiveResultSets。怀疑ToOneAsync之后没有释放DbDataReader.
Image

#### 数据库版本
Microsoft SQL Server 2017 (RTM-CU21) (KB4557397) - 14.0.3335.7 (X64)
Jun 12 2020 20:39:00
Copyright (C) 2017 Microsoft Corporation
Standard Edition (64-bit) on Windows Server 2016 Datacenter 10.0 (Build 14393: ) (Hypervisor)
#### 安装的Nuget包

Image

#### .net framework/. net core? 及具体版本

.net 10

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.