Does .net TransactionScope handle very complex database stuff?

I have been instructed to prove or disprove transaction support in .net. We all know that it TransactionScopecan handle the transfer / rollback of simple things, such as inserting 3 records in 3 different tables, and then deleting 5 records in 5 other tables.

My team is not sure that it TransactionScopecan handle the transaction correctly if these inserts / deletes have triggers. Or if we execute an SP that has its own nested transactions.

Does .net transaction support support these more complex situations? Do I need to point out some not so obvious options for this to work?

I heard that some of our SPs can cause problems, as some transactions are performed independently. Does anyone know if this particular TransactionScope script is processing?

+3
source share
1 answer

We use TransactionScope for some very complex and lengthy database operations with thousands of rows across dozens or more tables. He does a great job with this. However, IMO, you do NOT want to start and execute transactions in stored procedures and / or triggers. You must enable your call code (C #). You lose more flexibility by processing transactions at a lower level in the stored procedure.

, TransactionScope, . , MTC, , MTC .

+2

Source: https://habr.com/ru/post/1755035/


All Articles