代码之家  ›  专栏  ›  技术社区  ›  Denis Biondic

nhibernate2.1.2-如何禁用反射优化器

  •  0
  • Denis Biondic  · 技术社区  · 16 年前

    我想禁用反射优化(测试目的),但我不知道在哪里做。NH2.1.2使用XML中的hibernate配置,文档中明确指出不能在此处设置此设置。:/我试着用老的App.config方法用键/值对来做,运气不好。。。

    另外,nh2+版本是否改变了反射优化?

    1 回复  |  直到 16 年前
        1
  •  0
  •   rebelliard    16 年前

    你试过了吗

    <add key="hibernate.use_reflection_optimizer" value="false" />
    

    ?


    From the Hibernate Community:

    hibernate.use\u反射\u优化器 跟随。请注意,设置没有 在内部工作 休眠配置部分,所以我 必须把它放在一个新的地方 部分。代码现在似乎是 在中等信任环境中工作

      <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>