NHibernate w /数据库镜像通过连接字符串中的故障转移伙伴
问题描述:
我会通过说我正在使用NHibernate v3.2
序言这个问题。
比方说,我有一个连接字符串,如下面的(在这里关键是Failover Partner
):NHibernate w /数据库镜像通过连接字符串中的故障转移伙伴
Data Source=Server1\Instance;Failover Partner=Server2\Instance;Initial Catalog=MyDb;Integrated Security=True;
我发现一个hibernate
论坛该主题相关的以下文章:
https://forum.hibernate.org/viewtopic.php?f=25&t=979764
一用户提到了以下:We had a slight hiccup with the way we were caching our NHibernate session and had to add a method that verifies the session's connection is still open when we pull it out of the call context.
NHibernate的不支持此数据基地镜像选项开箱即用,因为它使用ADO.net?
在使用这样的连接字符串时,是否有任何特殊情况需要注意?
答
它支持这一点,并已在使用3.2的测试和生产系统中证明了这一点。它也适用于3.3。
我唯一需要注意的是我通过读取配置设置在页脚中显示数据库服务器。如果故障转移伙伴正在使用,这仍然会显示数据源并且没有找到显示的简单方法。