I am currently migrating a WinApp to use nhibernate, however I'm experiencing very slow startup times (up to 2 mins!!) due to the creation of the NHibernate configuration. I currently only have 10 tables/classes in my config.
My question is ... is this a typical load time or am I possibly doing something wrong? Should I not be using NHibernate in Windows Apps for this reason? Is it intended to be used with ASP.NET applications due to this heavyweight start-up time?
My config code snippet looks like ...
Configuration cfg = new Configuration();
cfg.AddAssembly("CCCDbLib");
Stream stream = new FileStream(dbConfigFile, FileMode.Open);
cfg.Configure(new XmlTextReader(stream));
return cfg.BuildSessionFactory();
Any help greatly appreciated,
Regards,
Ronan
|