-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Slow BuildSessionFactory in WinForms App
PostPosted: Wed Mar 22, 2006 4:58 pm 
Newbie

Joined: Wed Mar 22, 2006 4:47 pm
Posts: 5
NHibernate version: 1.0.2.0

Hi there

I'm currently developing a WinForms application using NHibernate and have about 250 mappings in total.

The problem is that BuildSessionFactory is taking 25+ seconds to run which is causing problems for our Windows based app.

I understand that there's a lot of information to process in the mapping files, but is there any way to reduce this startup time, ie caching the result of the process somewhere? Perhaps I should be looking to remove some complexity from my mapping files?

Any ideas would be appreciated.

Thanks for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 5:04 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Try disabling the reflection optimizer (set Environment.UseReflectionOptimizer to false before creating the Configuration).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 5:26 pm 
Newbie

Joined: Wed Mar 22, 2006 4:47 pm
Posts: 5
Excellent, that solved the problem!

I assume this may affect runtime speed in certain areas due to the optimization not having been processed, but I know I can't have it both ways ;-)

Thanks very much :-)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 3:06 pm 
Beginner
Beginner

Joined: Tue May 17, 2005 7:25 pm
Posts: 43
Location: Somewhere, USA
If you are using .NET 2.0, you should look at this forum thread. I think you can have your cake and eat it too!

:-)

http://forum.hibernate.org/viewtopic.php?t=956966


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.