NHibernateSession.Init slow (S#arp 2.0.4, ASP.NET MVC 4.0, VS2012 RC)

119 views
Skip to first unread message

joedirt

unread,
Aug 6, 2012, 9:54:45 AM8/6/12
to sharp-arc...@googlegroups.com
I'm looking to uplift our project from S#arp 1.0, ASP.NET MVC 1.0, etc.  I decided to start a test project from scratch with the latest toolset.  I am able to get the site running and have two basic objects (only the Id field) mapped from our database.  However, when I try to run the website from within VS2012 RC, there is a very long delay before the homepage is displayed.

I put in very crude debugging lines into Global.asax.cs just to get a very quick idea of where the time is being spent.  Here's the console log:

--Snip lots of dll lines loading--
8/6/2012 8:36:40 AM - Start Application_Start()
8/6/2012 8:36:41 AM - Start InitializeServiceLocator()
8/6/2012 8:36:41 AM - End InitializeServiceLocator()
--More DLLs loading --
8/6/2012 8:36:42 AM - End Application_Start()
8/6/2012 8:36:42 AM - Start Init
8/6/2012 8:36:42 AM - End Init
8/6/2012 8:36:42 AM - Start InitialiseNHibernateSessions()
8/6/2012 8:36:42 AM - Start AutoPersistenceModelGenerator.Generate()
8/6/2012 8:36:42 AM - End AutoPersistenceModelGenerator.Generate()
8/6/2012 8:38:55 AM - End InitialiseNHibernateSessions()
8/6/2012 8:38:57 AM - Start Init
8/6/2012 8:38:57 AM - Start Init
8/6/2012 8:38:57 AM - End Init
8/6/2012 8:38:57 AM - End Init

There is a 2+ minute delay that comes from the call to NHibernateSession.Init(...) which is within InitialiseNHibernateSessions().  I see some NHibernate discussion from 2010 regarding Fluent NHibernate and XML serialization.(http://nhforge.org/blogs/nhibernate/archive/2009/03/13/an-improvement-on-sessionfactory-initialization.aspx), but I'm not sure this is the same thing or not.

Is anyone else seeing a delay similar to mine?  I can understand that the initialization will take sometime, but the old project only takes 15 - 20 seconds with many, many more and complex objects.  Do I have a web.config setting wrong?  Is there something in the Infrastructure project I should do differently?

Thanks

Joe

Seif Attar

unread,
Aug 8, 2012, 10:55:30 AM8/8/12
to sharp-arc...@googlegroups.com
That is an insanely long time, it definitely shouldn't take that long.
What does your AutoPersistanceModelGenerator code look like? Do you
have any extra conventions configured?

I just tried it now with a solution that has 8 entities mapped, and
from hitting F5 to viewing the page it takes < 5secs
> --
> You received this message because you are subscribed to the Google Groups
> "S#arp Architecture" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sharp-architecture/-/24XwOX-u11sJ.
> To post to this group, send email to sharp-arc...@googlegroups.com.
> To unsubscribe from this group, send email to
> sharp-architect...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sharp-architecture?hl=en.
Reply all
Reply to author
Forward
0 new messages