-->
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: Reducing/optimising application startup time
PostPosted: Thu Sep 29, 2005 12:13 pm 
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


Top
  
 
 Post subject: Schema
PostPosted: Thu Sep 29, 2005 3:35 pm 
Newbie

Joined: Fri May 13, 2005 11:14 am
Posts: 18
In your mapping, are you referencing the DTD? I was having the same issue with long loading because I was loading the DTD through the web. The time issue went away when I removed that line.

This is the first 2 lines of one of my mapping files.

<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 6:14 pm 
Senior
Senior

Joined: Thu Jun 02, 2005 5:03 pm
Posts: 135
Location: Paris
Also, what level is your log4net logging set to? If you have it set to DEBUG then startup can take a long time if you have complex mappings.

Cheers,

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 3:49 am 
Thanks for the help!

Actually jd you were spot on. I was referencing the dtd in the mapping docs; took it away and my app starts pretty much instantaneously. I don't know how long it would of taken me to profile and find that.


Top
  
 
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.