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.