Skip to content

DB ConnectionTimeout,CommandTimeout 和 executionTimeout 的理解


原文:ConnectionTimeout,CommandTimeout 和 executionTimeout 的理解


ConnectionTimeout

获取在尝试建立连接时终止尝试并生成错误之前所等待的时间。

等待连接打开的时间(以秒为单位)。 默认值为 15 秒。

通过在连接字符串中使用 ConnectTimeoutConnection Timeout 关键字,可设置连接等候超时的时间量。

值 0 指示无限制,在 ConnectionString 中应避免值 0,否则会无限期地等待连接尝试。

CommandTimeout

获取或设置在终止执行命令的尝试并生成错误之前的等待时间。

等待命令执行的时间(以秒为单位)。 默认值为 30 秒。

值 0 指示没有限制 (尝试执行命令将无限期等待)。

在异步方法调用(如 BeginExecuteReader)过程中, CommandTimeout 属性将被忽略。

当对上下文连接(要用连接字符串中的 “context connection=true” 打开的 SqlConnection)执行命令时, CommandTimeout 将不起作用。

此属性是在执行命令或处理结果期间所有网络读取的累积超时。在返回第一行之后,超时仍然可能发生,但只包括网络读取时间,而不包括用户处理时间。

HttpRuntimeSection.ExecutionTimeout

获取或设置请求的允许执行时间。

ExecutionTimeout 指示在请求被 ASP.NET 自动关闭前允许执行的最大秒数。默认值为 90 秒。

xml
<httpRuntime maxRequestLength="102400" executionTimeout="720"/>

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.