gpt4 book ai didi

c# - 查询超时怎么办?

转载 作者:可可西里 更新时间:2023-11-01 08:21:07 25 4
gpt4 key购买 nike

假设我有一个查询被发送到我的 SQL-Server 数据库,它花费了 30 多秒,我的程序抛出了一个 SQL 查询超时异常。查询是否仍在我的数据库中进行,还是在抛出异常后立即终止?

最佳答案

A client signals a query timeout tothe server using an attention event.An attention event is simply adistinct type of TDS packet a SQLServer client can send to it. Inaddition to connect/disconnect, T-SQLbatch, and RPC events, a client cansignal an attention to the server. Anattention tells the server to cancelthe connection's currently executingquery (if there is one) as soon aspossible. An attention doesn'trollback open transactions, and itdoesn't stop the currently executingquery on a dime -- the server abortswhatever it was doing for theconnection at the next availableopportunity. Usually, this happenspretty quickly, but not always.

来源There's no such thing as a query timeout...

关于c# - 查询超时怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5810786/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com