I am using NHibernate to connect to a legacy rdbms system. Under high production load the rdbms service fails. To maintain the availability we have a failover rdbms service. Is there a way to configure NHibernate to use the FailOver Connection String when the primary connection is down?
Additional Info: I am using Castle over NHibernate. If Castle provides handling of failover connections then that will also do it for me.
You can build your own
NHibernate.Connection.IConnectionProviderwhich provides failover support.This should be a subclass of
ConnectionProviderwhich overridesCloseConnection()GetConnection()andConfigure().The connection provider is specified in your hibernate configuration as property
connection.provider.Here is an untested implementation which is based on DriverConnectionProvider.