开发者

MySQL timeout issues with connection already open

What I have going on is a basic update query, that updates based on a unique id, and below is my connection string.

    public static string masterConString = "SERVER=192.168.0.12;" +
                                           "UID=;" +
                                           "PASSWORD=;" +
                                           "connectiontimeout = 240000;";

UID and password are correct.

However, I cannot figure out why I'm getting random connection timeout issues. I have about 8 open connections to the server.

System.TimeoutException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connect h开发者_如何学Cost failed to respond --->


The connection string timeout ONLY applies to opening the connection. Once the connection is open, you set the timeout for operations within that connection separately. For example, if you are using LINQ to SQL, the DataContext class has a CommandTimeout property for setting this. In the case of DataContext, the default is 30 seconds.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜