TransactionScope的;发生异常后如何提交

时间:2013-05-10 16:55:21

标签: sql-server exception transactionscope

我正在改造一个有点复杂的程序。有数百个UI可以使用反射来调用方法列表。有些方法基本上称为第三方DLL。一些DLL抛出异常。

有1个DLL抛出异常,显然只是说我已经完成了。从数据库的角度来看,可以安全地忽略此异常;但是我似乎无法让transactioncope忽略它。或者我对一些transactioncope环境行为一无所知。

到目前为止的逻辑

使用Transactionscope required

for each item in the methods list..
  ... lots of code hitting databases.. that works

  one of the methods..
      using transactionscope suppress 

         try
             dagnamit.dll
         catch exception  -- this exception I want transactionscope to ignore
         end try

         transactionscope Completed
     end using

... more code .. that works when dagnamit.dll isn't called
                 but fails when called, reporting can't call a "disposed object: Transaction:

transactionscope Completed

结束使用

超时不是问题。是的,涉及多个服务器。当然我无法访问DLL源代码。

0 个答案:

没有答案