-->
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: swapping session factories
PostPosted: Tue Jun 07, 2016 11:32 am 
Newbie

Joined: Tue Jun 07, 2016 11:23 am
Posts: 3
My application has 1000 hbm files, in multiple jars, which get loaded by session factory automatically during application startup time. Because of the numbers of hbm files, Configuration.buildSessionFactory takes ~90secs. To reduce the startup time, I was thinking to create a dummy sessionFactory which loads handful of hbm files (or jars). But in parallel thread, I will be creating fully fledge second sessionFactory. Once my second session factory is completed then I would like to hotswap with my dummy session factory.

Would it be possible to do the above? it yes, then
1. how would I stop sessionFactory to load all the hbm files and ask dummy session factory to load few hbm files.
2. how would I do hot swap as few of the spring beans will the accessing the dummy sessionfactory as startup time.


Top
 Profile  
 
 Post subject: Re: swapping session factories
PostPosted: Wed Jun 08, 2016 1:19 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Or you could just split that app into multiple ones (front-end and back-end) and load them in parallel. You can also profile to determine what takes that long and try to fix that after you know exactly the culprit.


Top
 Profile  
 
 Post subject: Re: swapping session factories
PostPosted: Wed Jun 08, 2016 6:42 am 
Newbie

Joined: Tue Jun 07, 2016 11:23 am
Posts: 3
mihalcea_vlad wrote:
Or you could just split that app into multiple ones (front-end and back-end) and load them in parallel. You can also profile to determine what takes that long and try to fix that after you know exactly the culprit.


Currently we cannot split into multiple app. Can you please help me to switch off auto loading of HBM file from jars? Then I would like create and swap two session factories and see the implications.


Top
 Profile  
 
 Post subject: Re: swapping session factories
PostPosted: Wed Jun 08, 2016 6:56 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
You can try to set the hibernate.archive.autodetection property like this:

Code:
<property name="hibernate.archive.autodetection"></property>


Top
 Profile  
 
 Post subject: Re: swapping session factories
PostPosted: Mon Jun 13, 2016 6:42 am 
Newbie

Joined: Tue Jun 07, 2016 11:23 am
Posts: 3
aabhisheksinha wrote:
My application has 1000 hbm files, in multiple jars, which get loaded by session factory automatically during application startup time. Because of the numbers of hbm files, Configuration.buildSessionFactory takes ~90secs. To reduce the startup time, I was thinking to create a dummy sessionFactory which loads handful of hbm files (or jars). But in parallel thread, I will be creating fully fledge second sessionFactory. Once my second session factory is completed then I would like to hotswap with my dummy session factory.

Would it be possible to do the above? it yes, then
1. how would I stop sessionFactory to load all the hbm files and ask dummy session factory to load few hbm files.
2. how would I do hot swap as few of the spring beans will the accessing the dummy sessionfactory as startup time.


Does anyone know how to find HBM files used during startup. Few of our components use database (through hibernate) during server startup. I can use Spring AOP if some one can point me Hibernate method.


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.