TransactionScope Complete() doesn't commit the transaction before exiting the USING statement

前端 未结 1 1938
死守一世寂寞
死守一世寂寞 2021-02-20 05:08

I am experiencing this weird behavior where the transaction gets committed only when the using exits and not when calling scope.Complete();

<         


        
相关标签:
1条回答
  • 2021-02-20 06:02

    from the documentation:

    The actual work of commit between the resources manager happens at the End Using statement if the TransactionScope object created the transaction.

    So it doesn't look like you can truly commit the transaction before the using statement end.

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