.NET TransactionScope class and T-SQL TRAN COMMIT and ROLLBACK

前端 未结 4 1492
庸人自扰
庸人自扰 2020-12-11 20:11

I am current writing an application that will require multiple inserts, updates and deletes for my business entity. I am using the TransactionScope class to guarantee all t

4条回答
  •  [愿得一人]
    2020-12-11 20:50

    No, you don't need explicit transactions if using TransactionScope for your transactions - however: important you should probably set Transaction Binding=Explicit Unbind; in the connection string. The full details are here, but otherwise you can end up with the first few operations getting rolled back, and the last few committing (or rather, running outside of any transaction).

提交回复
热议问题