Unable to get error message 无法获取错误消息 (6107)(0) 分布式事务 TransactionScope Oracle


今天遇到了一个奇葩问题,业务运行了不到1分钟,就跑出来一个数据库错误,而且还是不定行的,错误内容是 无法获取错误消息(6107)(0) , 英文是 Unable to get error message(6107)(0) ,

如果大家谁还遇到这个问题,那我帮你定位 100% 是分布式事务 超时所引起的。一般在打开事务的地方需要设置超时时间

 using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(1, 0, 0)))
            {




}

我的超时情况比较复杂,因为事务里面还有WCF 访问,所以WCF 的连接超时也会影响分布式事务,设置WCF的时间

<binding name="transactionalBinding" receiveTimeout="00:30:00" sendTimeout="00:30:00">
          <textMessageEncoding>
            <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="64"/>
          </textMessageEncoding>
	<transactionFlow transactionProtocol="WSAtomicTransaction11"/>
          <httpsTransport manualAddressing="false" maxBufferPoolSize="524288"
            maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Anonymous"
            bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
            keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous"
            realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
            useDefaultWebProxy="true" />
        </binding>

另外还要设置Web.Config 对于这个应用的分布式事务超时

  <system.transactions>
  <defaultSettings timeout="00:30:00" />
  </system.transactions>

最后一点,如果还是在10分钟内就断掉了,就要设置Machine.Config 了

C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG

<configuration>
 <system.transactions>
   <machineSettings maxTimeout="00:30:00" />
 </system.transactions>
</configuration>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值