0

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

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

到目前为止的逻辑

需要使用事务范围

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 源。

4

0 回答 0