Npgsql 命令超时值;0 是不确定的吗? [英] Npgsql Commandtimeout Value; Is 0 indefinite?

查看:37
本文介绍了Npgsql 命令超时值;0 是不确定的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我还没有真正发现任何明确说明这一点的内容.如果我在 npgsql 中为连接对象设置 Commandtimeout 值,是否会将其设置为无限期等待?

I haven't really found anything that categorically states this. If I set the Commandtimeout value for a connection object in npgsql, will that set it to wait indefinitely?

推荐答案

是的,0 是无限的.

Npgqlstate.cs 包含如下代码 context.Mediator.CommandTimeout >0因此,如果 CommandTimeout 为 0,Npgsql 将永远等待.

Npgqlstate.cs contains code below which as context.Mediator.CommandTimeout > 0 So if CommandTimeout is 0, Npgsql waits forever.

internal IEnumerable<IServerResponseObject> ProcessBackendResponsesEnum(NpgsqlConnector context,
    bool cancelRequestCalled)
{
    try
    {
    // Process commandTimeout behavior.

    if ((context.Mediator.CommandTimeout > 0) &&
            (!CheckForContextSocketAvailability(context, SelectMode.SelectRead)))

这篇关于Npgsql 命令超时值;0 是不确定的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆