【发布时间】:2011-06-17 13:37:07
【问题描述】:
在我的项目中,DAL 是 WCF 服务 .Net4.0。使用数据库 oracle 11g。我在 WCF(服务器端)中使用事务范围。 如果任何一个 sp 失败,我必须在方法(操作合约)中调用多个存储过程,我需要回滚已经执行的 sp。但回滚没有发生。我没有使用客户端事务流程。
我已经放了示例代码
公共类服务:IService {
public bool Method1()
{
using (TransactionScope Scope1 = new TransactionScope())
{
Method2();
Method3();
Scope1.Complete();
}
return true;
}
public bool Method2()
{
using (TransactionScope Scope2 = new TransactionScope())
{
// Procedure call .....
Scope2.Complete();
}
return true;
}
public bool Method3()
{
using (TransactionScope Scope3 = new TransactionScope())
{
// Procedure call .....
Scope3.Complete();
}
return true;
}
}
【问题讨论】:
-
你能把你的代码贴出来
标签: wcf transactions transactionscope