1

in my app, transaction scope is there, inside that i'm doing all copying operation to dc object and finnally dc.submittchanges() will be performed.

Will the transaction scope locks down the table present in dc?, will this cause any deadlocks?

Eg:

  using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, TimeSpan.FromSeconds(30)))
            {
                using (var dc = new ProposalDataContext(_ConnectionString))
                {
    scope.Complete(); 
                }
            }
4

1 回答 1

7

TransactionScope使代码块具有事务性。虽然代码尚未被COMMITED涉及的表将被锁定,但如果另一个进程请求所涉及的表的内容,它将不得不等到事务提交或回滚。

于 2013-07-01T09:17:38.000 回答