views:

55

answers:

1

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?

A: 

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>
Rafael Belliard
Yes I did, but with no luck. NH seems to ignore <hibernate> section in App.config, it just looks for <hibernate-configuration> where you can't define this setting...
Sapphire
@Sapphire: please take a loot at my edit and see if that forum answer helps you too.
Rafael Belliard