【发布时间】:2011-02-14 20:06:14
【问题描述】:
TransactionScope 是否适用于关闭的数据库连接?
using (var transaction = new TransactionScope(TransactionScopeOption.Required))
{
// creates a new connection, does stuff, commit trans and close
repos1.DoSomething();
// creates a new connection, does stuff, commit trans and close
repos2.DoSomething();
transaction.Complete();
}
【问题讨论】:
标签: .net transactionscope