nhibernatenhibernate-envers

Envers with Nhibernate - SetEnversProperty


I'm attempting to setup NHibernate.Envers to use a separate database, schema and table suffix. For some reason, the configuration changes I'm setting at being ignored.

Example Code

var nhCfg = new Configuration().Configure();
nhCfg.IntegrateWithEnvers(new AttributeConfiguration());
nhCfg.SetEnversProperty(ConfigurationKey.AuditTableSuffix, "_Log");
nhCfg.SetEnversProperty(ConfigurationKey.DefaultCatalog, "LoggingDatabase");
nhCfg.SetEnversProperty(ConfigurationKey.DefaultSchema, "log");

Does anyone have any suggestions? I'm not sure if I am missing something to commit the configuration change.


Solution

  • Set envers properties before calling IntegrateWithEnvers.