I want to disable reflection optimization (testing purposes), but i don't know where to do it. NH开发者_开发技巧 2.1.2 uses hibernate-configuration in XML, and docs clearly state that this setting can not be set here. :/ I tried doing it the old App.config way with key/value pairs, no luck ...
Also, did NH 2+ version change something about reflection optimization?
Did you try
<add key="hibernate.use_reflection_optimizer" value="false" />
?
From the Hibernate Community:
I was able to set the hibernate.use_reflection_optimizer property in the web.config file as follows. Note that the setting did not work within the hibernate-configuration section, so I had to place it in a new nhibernate section. The code now appears to be working in a medium trust environment ( godaddy )
<configSections>
<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"
requirePermission="false"/>
<section name="nhibernate"
type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089"
requirePermission="false"/>
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MySQLDialect</property>
<property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
<property name="connection.connection_string">blahblah</property>
</session-factory>
</hibernate-configuration>
<nhibernate>
<add key="hibernate.use_reflection_optimizer" value="false" />
</nhibernate>
精彩评论