对于SQL的ConnectionString与ConnectionTimeout故障转移合作伙伴的行为 [英] Failover Partner behavior for Sql ConnectionString with ConnectionTimeout

查看:194
本文介绍了对于SQL的ConnectionString与ConnectionTimeout故障转移合作伙伴的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是.NET 4.0中和的SqlConnection / SqlCommand的连接到2008 R2 SQL服务器已经镜像设置。 ConnectionString中指定故障转移伙伴

I'm using .Net 4.0 and SqlConnection/SqlCommand to connect to a 2008 R2 SQL server that has mirroring setup. The ConnectionString specifies a Failover Partner

任何人都可以解释为什么ConnectionTimeout设置会影响到故障转移到镜像的能力,为客户? IE浏览器总是等待为ConnectionTimeout才去的故障转移服务器?抑或是故障转移成为主要指的是客户端将立即切换到连接到无视为ConnectionTimeout故障转移?

Can anyone explain how the ConnectionTimeout setting affects the ability for a client to failover to the mirror? Ie does it always wait the ConnectionTimeout before going to the failover server? Or does the failover becoming primary mean the client will immediately switch to connecting to the failover disregarding the ConnectionTimeout?

我阅读MSDN文章数据库镜像SQL Server的在初始连接到数据库镜像会话和他们谈的客户端会自动连接到当主服务器宕机的镜子,但会具有高ConnectionTimeout指定的影响时,将采取客户端连接到故障转移服务器?

I read the MSDN articles Database Mirroring in SQL Server and Making the Initial Connection to a Database Mirroring Session and they talked about the client automatically connecting to the mirror when the main server is down, but would having a high ConnectionTimeout specified affect the time it would take the client to connect to the failover server?

我要对我的所有连接字符串设置为ConnectionTimeout到至少150 <一个href="http://msdnrss.the$c$crblogs.com/2011/05/ado-net-application-connecting-to-a-mirrored-sql-server-database-may-timeout-long-before-the-actual-connection-timeout-elapses-sometimes-within-milliseconds/"相对=nofollow>由于ADO.NET 一个已知的bug。而我们所关心的巨大超时会影响应用程序来处理及时故障切换的能力

I have to set the ConnectionTimeout on all of my connection strings to at least 150 due to a known bug in ADO.NET. And we are concerned a huge timeout will affect the ability of apps to handle failovers in a timely manner

推荐答案

如果主数据库服务器不可用,那么ADO.Net将立即尝试与故障转移合作伙伴。如果主服务器缴费,但要求数据库处于镜像状态时,ADO.Net来电将被重定向到主服务器(这可能会或连接字符串故障转移伙伴可能不匹配)。这意味着主数据库和服务器的可用性任何其他情况将等待超时或错误。

If the primary database server is not available, then ADO.Net will immediately attempt to contact the failover partner. If the primary server is avaiable, but the requested database is in a mirrored state, the ADO.Net caller will be redirected to the principal server (Which may or may not match the connection string failover partner). Any other situation which implies availability of the primary database and server will wait for a timeout or error.

这篇关于对于SQL的ConnectionString与ConnectionTimeout故障转移合作伙伴的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆