Skip to content

SqlSugarCore 5.1.4.218 连接达梦数据库有连接泄漏的问题 #1455

Description

@meng-xianghu

连接信息,连接池设置为 1
Server=xxx;Port=5236;Database=DMSERVER;User Id=xxx;Password=xxx;connPooling=true;connPoolSize=1;connPoolCheck=true;

代码
builder.Services.AddSqlSugar(new IocConfig()
{
ConnectionString = StaticConfigHelper.GetDBConnectionString(),
DbType = IocDbType.Dm,
IsAutoCloseConnection = true
});

public ReturnResult QueryOracle()
{
// 目前发现 非 Async 方法有连接泄漏问题
DbScoped.Sugar.Queryable<EAM_DEV>().First();
return new ReturnResult() { successed = true };
}

第一次请求正常
第二次请求报错
SqlSugar.SqlSugarException
HResult=0x80131500
Message=中文提示 : 连接数据库过程中发生错误,检查服务器是否正常连接字符串是否正确,错误信息:6123,Timeout when get connection from connpool
[extraInfo]:{get}->{TryDequeue()}->{TryDequeue() failed}->{DequeueTimeout(timeout)}->{DequeueTimeout(timeout) failed}->{totalCount=1}->{limit=1}->{ConnPoolSize=1}DbType="Dm";ConfigId="".
English Message : Connection open error . 6123,Timeout when get connection from connpool
[extraInfo]:{get}->{TryDequeue()}->{TryDequeue() failed}->{DequeueTimeout(timeout)}->{DequeueTimeout(timeout) failed}->{totalCount=1}->{limit=1}->{ConnPoolSize=1}DbType="Dm";ConfigId=""
Source=SqlSugar
StackTrace:
在 SqlSugar.Check.Exception(Boolean isException, String message, String[] args)
在 SqlSugar.AdoProvider.CheckConnection()
在 SqlSugar.DmProvider.GetCommand(String sql, SugarParameter[] parameters)
在 SqlSugar.AdoProvider.GetDataReader(String sql, SugarParameter[] parameters)
在 SqlSugar.QueryableProvider1.GetData[TResult](KeyValuePair2 sqlObj)
在 SqlSugar.QueryableProvider1._ToList[TResult]() 在 SqlSugar.QueryableProvider1.ToList()
在 SqlSugar.QueryableProvider`1.First()

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions