配置文件如下  

<?xml version="1.0"?>
<configuration>
    
<configSections>
        
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler,NHibernate"/>
        
<section name="syscache" type="NHibernate.Caches.SysCache.SysCacheSectionHandler,NHibernate.Caches.SysCache" />
    
</configSections>
    
<connectionStrings>
        
<add name="db" connectionString="Server=.;Database=NHTest;Trusted_Connection=SSPI"/>
        
<add name="nhtest" connectionString="Data Source=orcl; Persist Security Info=True;Integrated Security=False;User ID=nhtest;Password=nhtest;"/>
    
</connectionStrings>

    
<!--Oracle-->
    
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
        
<session-factory>
            
<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle</property>
            
<property name="dialect">NHibernate.Dialect.Oracle10gDialect,NHibernate</property>
            
<property name="connection.driver_class">NHibernate.Driver.OracleClientDriver,NHibernate</property>
            
<property name="connection.connection_string_name">nhtest</property>
            
<property name="adonet.batch_size">100</property>
            
<property name="show_sql">true</property>
            
<property name="hbm2ddl.auto">update</property>

            
<property name="cache.provider_class">NHibernate.Caches.SysCache.SysCacheProvider,NHibernate.Caches.SysCache</property>
            
<!--<property name="cache.use_second_level_cache">true</property>
            
<property name="cache.use_query_cache">true</property>-->

            
<!--<class-cache class="Test.Nh3.Domain, Test.Nh3" region="hourly" usage="read-only"/>-->

        
</session-factory>
    
</hibernate-configuration>
    
<syscache>
        
<cache region="hourly" expiration="60" priority="3" />
    
</syscache>

    
<runtime>
        
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            
<dependentAssembly>
                
<assemblyIdentity name="NHibernate" publicKeyToken="AA95F207798DFDB4" culture="neutral"/>
                
<bindingRedirect oldVersion="0.0.0.0-3.0.0.2002" newVersion="3.0.0.2002"/>
            
</dependentAssembly>
        
</assemblyBinding>
    
</runtime>
</configuration>

相关文章:

  • 2021-05-27
  • 2021-10-08
  • 2022-12-23
  • 2021-10-05
  • 2019-10-05
  • 2021-06-22
  • 2021-06-22
猜你喜欢
  • 2022-12-23
  • 2021-05-13
  • 2019-10-10
  • 2021-09-03
  • 2022-12-23
  • 2021-04-12
  • 2021-05-10
相关资源
相似解决方案