Fluent NHIbernate Freezes much

According to profiler it takes 24 sec for FluentConfiguration.BuildConfiguration to complete. Here's the code I use to get Configuration:

    MsSqlConfiguration persistenceConfigurer = MsSqlConfiguration
         .MsSql2005
         .ConnectionString(connectionStringBuilder => connectionStringBuilder
                                                      .Server(server)
                                                      .Database(database)
                                                      .Username(userName)
                                                      .Password(password))
         .ProxyFactoryFactory<ProxyFactoryFactory>()
         .CurrentSessionContext<ThreadStaticSessionContext>()
         .DoNot.ShowSql();

FluentConfiguration cfg = Fluently.Configure()
   .Database(persistenceConfigurer)
   .Mappings(m => m.FluentMappings.AddFromAssemblyOf<ExecutorMap>());

return cfg.BuildConfiguration();

The number of map-files is 19. Is it common for Fluent NHibernate to work so long? Might it be my fault? What could be wrong? Thanks in advance.

Answers


If you're using a profiler, you should be able to see what calls inside of BuildConfiguration are taking up that time. What are they?

Assembly scanning would be my guess. Is the assembly that contains your mappings especially large? You've told Fluent NHibernate to scan your assembly for mappings, so regardless of how few mappings there are it still has to scan the entire assembly for them.


Need Your Help

Using prototype for KnockoutJS computed properties

knockout.js

Is it recommended to create computed properties on the prototype object?

java Constructor of class Printwriter

java wildcard printwriter

In one of the sample code I saw, there is such a line:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.