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


i experiencing weird behavior transaction gets committed when using exits , not when calling scope.complete();

using (transactionscope scope = new transactionscope(transactionscopeoption.requiresnew))        {         scope.complete();            // data still doesn't show in db        }        // shows in db 

how commit transaction before exiting using statement?

from documentation:

the actual work of commit between resources manager happens @ end using statement if transactionscope object created transaction.

so doesn't can commit transaction before using statement end.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -