Connection problems with SQL Server in ASP.NET applications using out-of-process session state

后端 未结 4 521
情歌与酒
情歌与酒 2020-12-13 18:53

I have several ASP.NET applications deployed in a farm of 4 Windows 2003 machines. Each application uses a separate App Pool and Virtual Directory in IIS. They rely heavily

相关标签:
4条回答
  • 2020-12-13 19:03

    Transport level errors are often linked to the connection to sql server being broken ... usually network.

    Timeout Expired is usually thrown when a sql query takes too long to run.

    So I would troubleshoot the link to your Sql Server and then monitor to see what queries are timing out.

    Sounds like a SQL job is running, backup? That might be locking tables or restarting the service.

    0 讨论(0)
  • 2020-12-13 19:08

    Set CommandTimeout = 120 in the connection string.

    Try adding a Connect Timeout in the web.config:

    <add key="DBConnection" value="server=LocalHost;uid=sa;pwd=;database=DataBaseName;Connect Timeout=200; pooling='true'; Max Pool Size=200"/>
    

    Please reply back if this works....

    0 讨论(0)
  • 2020-12-13 19:17

    It might be the case in which the length of your query exceeds the limitation of 65,536 * Network Packet Size (default 4KB).

    0 讨论(0)
  • 2020-12-13 19:23

    In my case the problem was related with host TCP configuration (virtual machine in VMWare). After quick research (some article found in Google and MSDN Blogs) I've turned off in system registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\synattackprotect (0) and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\EnableTCPChimney (0). Now it works just fine. Of course this was only test machine (corporate network not visible from Internet) and I wouldn't do that on production environment ;-)

    0 讨论(0)
提交回复
热议问题