Is it possible to exclude a transaction from voting within a transaction?

Each transaction is within the range of transactions for voting. And TS works like everything has nothing.

I want to wrap several methods with a transaction.

using(var ts = new TransactionScope())
{
    DoSomething1();
    DoSomething2();

    ts.Complete();
}

Both methods open connections and try to commit. They try several times to reconnect with the transaction in case of lock timeouts. Therefore, I need to exclude unsuccessful transactions from the vote and leave successful.

+3
source share
2 answers

Put repeat logic out of bounds TransactionScope. You cannot exclude operations after they are completed. Before performing an operation, membership in the transaction must be determined.

, , TransactionScopeOption.RequiresNew, TransactionScope, TransactionScope .

, . , . - , - . .

+2

" ", ACID. , , - .

, TransactionScopeOption

: . .

, , , . , ?

+1

All Articles