SqlConnection and TransactionScope Timeout

こ雲淡風輕ζ 提交于 2019-12-12 10:25:03

问题


I have a TransactionScope (over DTC, read committed) with a timeout of 60 minutes. In the TransactionScope I have opened the connection (I hope to enlist in the transaction) but after 30 seconds I get a timeout.

In the machine.config I changed the system.transaction maxTimeout to 60 minutes.

Why does the timeout occur after 30 seconds?


回答1:


A SqlCommand already has a CommandTimeout property that defaults to 30 seconds. May be you are using it within your transaction.



来源:https://stackoverflow.com/questions/3752440/sqlconnection-and-transactionscope-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!