TransactionScope Prematurely Completed

前端 未结 7 852
[愿得一人]
[愿得一人] 2020-12-13 02:01

I have a block of code that runs within a TransactionScope and within this block of code I make several calls to the DB. Selects, Updates, Creates, and Deletes, the whole ga

相关标签:
7条回答
  • 2020-12-13 02:52

    Confirmed this error can also be caused by a transaction timeout. Just to add to what Marcus + Rolf have stated, if you haven't explicitly set a timeout on the TransactionScope, the timeout TimeSpan will assume a default value. This default value is the smaller of:

    1. If you've overridden the local app.config / web.config setting, e.g.

      <system.transactions>
      <defaultSettings timeout="00:05:00" />
      </system.transactions>
      
    2. But this is then 'capped' at the machine.config setting <machineSettings maxTimeout="00:10:00" />

    0 讨论(0)
提交回复
热议问题