I'm currently working on creating a custom connection provider for HNibernate very similar to the one mentioned here. In it, they specify a separate connection string within the hibernate.cfg.xml parameters. However, when I go to add this new parameter, like so...
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory>
<property name="connection.provider">MyNameSpace.FailoverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect,NHibernate</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">[primary connection string]</property>
<property name="connection.failover_connection_string">[failover connection string]</property>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
...
</session-factory>
</hibernate-configuration>
... I am treated to this exception message:
InnerException {"The 'name' attribute is invalid - The value 'connection.failover_connection_string' is invalid according to its datatype 'String' - The Enumeration constraint failed."} System.Exception {System.Xml.Schema.XmlSchemaValidationException}
My question is: is it even possible to add custom properties to the NHibernate configuration file? If so, how?
Thanks!