I'm not sure if this will work, but it's an idea.
I don't use config files to setup NHibernate, I do it all from code. So, perhaps you can do the same thing, except setup two SessionFactories, one for each database.
As far as choosing the database for your classes, you need to put them in different assemblies. So if class1, 2 and 3 belong to databaseA, then put their hbm.xml files in MapAssemblyA. and if class 4, 5 and 6 belong to databaseB, then put them in MapAssemblyB. When you create your session factory for databaseA, only load MapAssemblyA, and do the same for assemblyB.
I think this might give you a start in the right direction. Let me know how it turns out, I might have a simliar need in the future.
Code:
_nHConfiguration = new Configuration();
_nHConfiguration.Properties.Add("hibernate.connection.provider",
"NHibernate.Connection.DriverConnectionProvider");
_nHConfiguration.Properties.Add("hibernate.dialect",
"NHibernate.Dialect.Oracle9Dialect");
_nHConfiguration.Properties.Add("hibernate.connection.driver_class",
"NHibernate.Driver.OracleClientDriver");
_nHConfiguration.Properties.Add("hibernate.connection.connection_string",
string.Format(
Core.Configuration.Database.ConnectionStringTemplate,
Core.Configuration.Database.Name,
Core.Configuration.Database.ConnectionUsername,
Core.Configuration.Database.ConnectionPassword));
_nHConfiguration.Properties.Add("hibernate.show_sql", "true");
_nHConfiguration.AddAssembly("ChemRex.Application");
_nHConfiguration.AddAssembly("ChemRex.Security");
_nHConfiguration.AddAssembly("ChemRex.Core");
_hNSessionFactory = _nHConfiguration.BuildSessionFactory();