简体   繁体   中英

Migration from NHibernate 2.1 to Nhibernate 3.3

I 'm in process of migrating from NHibernate 2.1 to Nhibernate 3.3. Please can anybody tell me briefly the steps to do so. Following are the DLL's I'm using in my current Project

  1. NHibernate.ByteCode.Castle 2.1
  2. NHibernate 2.1
  3. log4net 1.2
  4. Iesi.Collections 1.0
  5. FluentNHibernate 1.0
  6. Castle.DynamicProxy2 2.1
  7. Castle.Core 1.1
  8. Autofac 2.2
  9. Antlr3.Runtime 3.1

Also is there any need to change the code in the Fluent Hibernate Configuration? Following is the code.

 if (_config == null)
 {
     _config = Fluently.Configure()
         .Database(MsSqlConfiguration.MsSql2008
             .ConnectionString(cs => cs.Is(ConnectionString))
             .AdoNetBatchSize(2000)
             .Raw("command_timeout", "600")

             .ProxyFactoryFactory("NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle")
             .ShowSql()
         )
   .
   .
   .
  }

Please let me know which DLL(s) to remove/upgrade and the changes in the Fluent NHibernate Code if any.

  • NH 3.3 has merged most of these dll's so NHibernate.dll (and .xml) is all you need
  • FLuentNHibernate only ships with 1 dll which has to be upgraded (there should be a 1.3 which is compatible with >= NH 3.2, may need a assembly redirect for NH 3.3)
  • in FluentNHibernate config .ProxyFactoryFactory() should be removed
  • Castle.DynamicProxy2 and Autofac have nothing to do with NHibernate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM