WCF分布式开发常见错误(16):The Transaction has aborted,事务已经被中断

    今天调试WCF事务代码遇到这个问题:The Transaction has aborted,事务已经被中断。
  具体信息如下图:
WCF分布式开发常见错误(16):The Transaction has aborted,事务已经被中断_第1张图片
解决办法:
1.Transaction timed out 设置问题。增加配置代码火属性:
      < serviceBehaviors >
        
< behavior name = " WCFService.WCFServiceBehavior "   >
          
< serviceMetadata httpGetEnabled = " true "    />
          
< serviceDebug includeExceptionDetailInFaults = " true " >
          
</ serviceDebug >
          
          
< serviceTimeouts transactionTimeout = " 00:30:00 " />
        
</ behavior >
      
</ serviceBehaviors >
2.如果你设置了 [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete =false)]:
增加OperationContext.Current.SetTransactionComplete(),在符合要求的代码里提交事务。
3.我在还继续查找其它的解决办法。
查找到资料:
 
1.http://social.msdn.microsoft.com/Forums/en-US/windowstransactionsprogramming/thread/5eab0a10-b0f8-42e3-b870-463c912a4d2e;
2.http://netindonesia.net/blogs/kasim.wirama/archive/2007/12/11/transaction-in-windows-communication-foundation-wcf.aspx;
3.http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/9f9c1d11-6c0d-423e-bffc-4d1957e9bdd7;
 欢迎补充!~~

你可能感兴趣的:(分布式,transaction,WCF,aborted,事务已经被中断)