-->
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: Problem opening session
PostPosted: Fri Oct 27, 2006 11:51 am 
Beginner
Beginner

Joined: Fri May 12, 2006 10:48 am
Posts: 33
Hi, I’m using nhibernate in a very big project and I have the following problem, when I execute the application, in de main form I’m getting a new session (OpenSession()) and it’s taking a lot of time.
Anybody has any suggestion to improve performance?

Thanks Martin


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 28, 2006 12:53 am 
Regular
Regular

Joined: Tue Feb 21, 2006 9:50 am
Posts: 107
if this happens only on application startup, try

Code:
<add key="hibernate.use_reflection_optimizer" value="false" />


in your configuration.

Regards
Klaus


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 30, 2006 10:36 am 
Beginner
Beginner

Joined: Fri May 12, 2006 10:48 am
Posts: 33
Klaus, it works really well.
Thank you very much for your reply.

Do you know what change that key?
Can you explain me a little bit more about it?

Thanks again, Martin


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 1:14 am 
Regular
Regular

Joined: Tue Feb 21, 2006 9:50 am
Posts: 107
NHibernate dynamically generates proxy classes to access the getters and setters of your model classes on startup by default to omit the permanent use of reflection. If you have mapped many classes this process will take some time. The advantage is, that the overall performance is a little bit better. The option i told you disables this behavior. NHibernate will access your mapped classes via reflection all the time.

Me and my team are just implementing an application which use a quite big model which contains around 100 classes. We have done some performance tests with and without setting the option and found that the performance penalty is in the range of tenths of a second. So we decided to accept this as the startup time of the application was inaccepatable 1 - 2 Minutes depending on the hardware.

Regards
Klaus


Top
 Profile  
 
 Post subject: Optimized ReflectionOptimizer
PostPosted: Tue Oct 31, 2006 11:01 am 
Beginner
Beginner

Joined: Sat Sep 09, 2006 5:55 am
Posts: 23
It just occurred to me that it is actually strange that you'd have to generate these classes each time you start the application; they will only differ between different releases of your application.

It would be nice to be able to generate an assembly with these classes upon release of your application, so that the classes just need to be loaded when the user starts the application in stead of re-generating them each time.

Is anybody aware of a reason why this would not be possible? If not, are there plans to support such behavior in future versions of NHibernate?

_________________
Cheers,

Guy Mahieu


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.