2012-03-06 45 views
1

我會通過說我正在使用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?
在使用這樣的連接字符串時,是否有任何特殊情況需要注意?

回答

2

它支持這一點,並已在使用3.2的測試和生產系統中證明了這一點。它也適用於3.3。

我唯一需要注意的是我通過讀取配置設置在頁腳中顯示數據庫服務器。如果故障轉移夥伴正在使用,這仍然會顯示數據源並且沒有找到顯示的簡單方法。