在我的应用程序使用以下方式来调用DB:.NET检测分布式事务
//do a transaction
using (TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required))
{
OperationOnDb1();
//when we open the connection to the “other db” in this call, the transaction would become distributed
OperationOnDb2();
//transaction is now distributed
transaction.Complete();
}
的问题是,Operation1和操作2 90%的时间使用相同的分贝......但也有他们使用两个数据库的情况下(错误)。如果交易分散,我想要得到一个异常。
如何检测交易是否被提升为分布式交易?
感谢,拉杜
非常感谢...你救了我的一天:) – 2010-11-25 12:13:47