【发布时间】:2012-01-11 12:37:07
【问题描述】:
我有几个事务将表单数据插入到 oracle 表中。
if (InsertQuarterly() == true)
{
InsertMeasures();
}
如果insertmeasures 程序成功执行,那么我必须调用另一个程序。
在InsertQuarterly 内,我正在调用 Web 服务方法将数据插入 Oracle 表
例如
sOUT = ws_service.InsertQuarterly(txtQ2dTarget.Text, txtQ3dTarget.Text)
对于InsertMeasures,我正在调用网络服务
sOUT = ws_service.InsertMeasures(txtachieveGold.Text, txtachieveDia.Text)
我的问题是如果InsertQuarterly 成功执行,但如果InsertMeasures 在事务期间失败,那么我也想回滚InsertQuarterly。
我怎样才能做到这一点?我可以使用OracleTransaction 和transaction.Rollback()。
但是我使用不同的网络服务方法进行交易。
这里如何管理回滚和提交?
处理交易的最佳程序是什么?
【问题讨论】:
标签: web-services oracle c#-2.0