c# - WCF数据服务-从mysql查看超时过期问题

标签 c# mysql wcf entity-framework wcf-data-services

我已经使用 mysql DB 创建了 wcf datatservices。我正在快速从表中获取数据。但是当我尝试从 View 获取数据时,它抛出超时异常。当直接在数据库中尝试时,数据变得非常快。

我尝试在 web.config 中设置以下内容。

 <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="NetHttpBinding" maxBufferPoolSize="2147483647"  closeTimeout="00:01:00"
                 openTimeout="00:01:00"  maxConnections="10"
                 receiveTimeout="00:10:00"
                 sendTimeout="00:10:00"
          maxBufferSize="524288" maxReceivedMessageSize="2147483647" />
      </netTcpBinding>
    </bindings>
    <services>
      <service name="MyService">
        <endpoint address="http://localhost:59825" binding="netTcpBinding"
          bindingConfiguration="NetHttpBinding" name="HttpBinding" />
      </service>
    </services>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
  </system.serviceModel>

仍然超时异常。

编辑1:

当我尝试使用表格时,数据正在获取。我创建了一个 View ,从同一个表中选择*。现在它也抛出超时异常。

请帮忙。

谢谢, 萨里莎。

最佳答案

<system.serviceModel>
  <bindings>
    <netTcpBinding>
    <binding name="longTimeoutBinding"
        receiveTimeout="00:10:00" sendTimeout="00:10:00">
      <security mode="None"/>
    </binding>
    </netTcpBinding>
   </bindings>

  <services>
    <service name ="longTimeoutService"
      behaviorConfiguration="longTimeoutBehavior">
      <endpoint address="net.tcp://localhost/longtimeout/"
        binding="netTcpBinding" bindingConfiguration="longTimeoutBinding">

      </endpoint>
    </service>
....

编辑:

如果您没有收到,请访问此链接: Explaination of different timeout types

关于c# - WCF数据服务-从mysql查看超时过期问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17964317/

相关文章:

.net - WCF 中 NetPeerTcpBinding 的替代方案

c# - 如何通过反射判断 C# 方法是否为异步/等待?

c# - 是什么原因导致此列表在以一种方式调用时通过引用传递,但通过另一种方式传递值?

c# - 在 .NET 中开发新的 RESTful Web 服务——我应该从哪里开始? ASP.NET-MVC、WCF?

mysql - "using join buffer"在 MySQL 查询的解释表中意味着什么?

java - Spring Boot - 数据源运行时错误

c# - 从应用程序的多个线程到数据库的多个连接是否会提高插入查询性能?

php - 发生数据库错误错误号: 1066 Not unique table/alias:

wcf - maxReceivedMessageSize 未修复 413 : Request Entity Too Large

c# - 带相互身份验证的 WCF