-->
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.  [ 5 posts ] 
Author Message
 Post subject: Improve NHibernate startup time?
PostPosted: Sat May 06, 2006 6:42 am 
Regular
Regular

Joined: Tue Feb 21, 2006 9:50 am
Posts: 107
Hello,

i'm working on an application which uses a database with around 100 tables. All tables of hte database are mapped via NHibernate. On application startup NHibernate needs around 20 seconds to build up his mapping.

First i thought that the enabled logging was responsible for the startup time, but this is not the fact. Disable logging brings only minor improvements in startup time.

I'm using the standard way of mapping suggested in the documentation (each class has it's own mapping file and the mappings are placed as embedded resources).

Our customer want's a fast and highly responsive UI so the startup time is inacceptable for him, so i'm looking for a solution to speed up the startup time of NHibernate.

I'm thinking about putting the initialization code for NHibernate in a background task. The applicaton shows some data from the database immediately after startup, so i have to implement additional control logic to ensure that the NHibernate startup is completed before i can read the data. If there is an alternate (and faster) way to init NHibernate i maybe can avoid this additional effort.

Regards
Klaus


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 06, 2006 1:30 pm 
Senior
Senior

Joined: Sat May 14, 2005 8:40 am
Posts: 130
Disable the reflection optimizer:
Code:
<nhibernate>
...
  <add key="hibernate.use_reflection_optimizer" value="false" />
</nhibernate>

_________________
Cuyahoga


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 07, 2006 12:59 am 
Regular
Regular

Joined: Tue Feb 21, 2006 9:50 am
Posts: 107
wow...

this causes an incredible decrease of startup time. The appllication is now up in less than a second.

Thanks for the tip.

Klaus


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 08, 2006 4:35 pm 
Beginner
Beginner

Joined: Tue May 17, 2005 7:25 pm
Posts: 43
Location: Somewhere, USA
You should look at this post.

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


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 12:09 pm 
Regular
Regular

Joined: Tue Feb 21, 2006 9:50 am
Posts: 107
i have read this posting but unfortunately i have to develop the application in .NET 1.1.

Regards
Klaus


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.