[英]Database mirroring with sql server does not work with my asp.net application using EF
I have database mirroring setup to work with the production database for my asp.net application. 我具有数据库镜像设置,可以与asp.net应用程序的生产数据库一起使用。 When the system fails over to the mirrored database, the application crashes because the connection string is invalid. 当系统故障转移到镜像数据库时,由于连接字符串无效,应用程序崩溃。
If the failover is dependent on a connection string, what kinds of changes do I need to make to my application in order to ensure that it can fail over without my manually changing the connection string? 如果故障转移取决于连接字符串,那么我需要对应用程序进行哪些更改,以确保无需手动更改连接字符串就可以进行故障转移?
Do I put exception handling behavior around the EF code where it automatically changes its connection string? 是否在自动更改其连接字符串的EF代码周围放置异常处理行为?
Depending on the type of failover you have set up, I believe there is a connection string property that you can specify the failover DB. 根据您设置的故障转移类型,我相信有一个连接字符串属性可以指定故障转移数据库。
Data Source=myServerAddress;Failover Partner=myMirrorServerAddress;Initial Catalog=myDataBase;Integrated Security=True;
From here: http://www.connectionstrings.com/sql-server-2008 从这里: http : //www.connectionstrings.com/sql-server-2008
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.