There are cases where an application may need to change connection strings depending on some condition. This can be in the context of a multi-tenant application, or perhaps a database failover scenario. In this recipe, I'll show you how to switch NHibernate connection strings at runtime.
log4net.dll, and the
Eg.Coremodel from Chapter 1.
System.Configurationfrom the .NET framework.
App.configwith a standard NHibernate and log4net configuration.
public class DynamicConnectionProvider : DriverConnectionProvider ...