How does ADO.NET' s SqlCommand.CommandTimeout work?

前端 未结 3 1636
甜味超标
甜味超标 2021-01-22 10:47

Consider a stored procedure that updates some rows about in 60 seconds without using a transaction. We set ADO.NET\'s SqlCommand.Timeout to 30 seconds.

SqlComma         


        
3条回答
  •  无人及你
    2021-01-22 11:26

    The answer is no, your attempted action on the server will fail after 30s, your SqlCommand object will throw an exception in your code (below) and the implicit stored procedure transaction will rollback.

    Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    ...at least this is the behavior that I can verify using SQL Server...

提交回复
热议问题