TransactionScope Prematurely Completed

前端 未结 7 853
[愿得一人]
[愿得一人] 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:30

    If an exception happens inside a TransactionScope it is rolled back. This means that TransactionScope is done. You must now call dispose() on it and start a new transaction. I'm honestly not sure if you can reuse the old TransactionScope or not, I've never tried, but I'd assume not.

提交回复
热议问题