asp.net - Should I use transacion scope in a shared hosting server? -


suppose have different methods , place them in transaction scope. every method open it's connection. need enable msdtc service in windows server. shared hosting server , can not enable it.

class debit {   public void inserta()   {     //insertcode   } } class credit {    public void insertb()   {    // insertcode   } } using (transactionscope ts = new transactionscope(transactionscopeoption.required))          {             debitbal debit = new debitbal();             creditbal credit = new creditbal();             debit.inserta();             credit.insertb();             ts.complete(); } 

i use entity framework statements. idea using transaction scope in shared hosting server?

see link how use transaction scopes entity framework

in link , explained 3 cases in transaction scope being used show rollback when error occurs during update of multiple entities:

1: when have multiple save calls context;

2: when have single save multiple object;

3: , transactions across multiple contexts.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -