Juergen Hoeller opened SPR-13732 and commented
Traditionally, the bottleneck in the startup performance of Spring applications is the initialization of expensive resources such as a JPA EntityManagerFactory or a Hibernate SessionFactory.
As an alternative to generalized parallel initialization of beans, we might be able to achieve some significant gain through specific background initialization options in LocalContainerEntityManagerFactoryBean / LocalSessionFactoryBean / LocalSessionFactoryBuilder, internally passing the actual build call on to a background thread after configuration validation and in particular dependency resolution happened. The exposed EntityManagerFactory / SessionFactory proxy (which we have for other reasons already) could then simply delegate method invocations to a Future of the target resource until it is known to be resolved, which is likely not to come before the very end of the startup phase.
Issue Links:
Referenced from: commits db1171d, 09cea6e
1 votes, 9 watchers
Juergen Hoeller opened SPR-13732 and commented
Traditionally, the bottleneck in the startup performance of Spring applications is the initialization of expensive resources such as a JPA
EntityManagerFactoryor a HibernateSessionFactory.As an alternative to generalized parallel initialization of beans, we might be able to achieve some significant gain through specific background initialization options in
LocalContainerEntityManagerFactoryBean/LocalSessionFactoryBean/LocalSessionFactoryBuilder, internally passing the actual build call on to a background thread after configuration validation and in particular dependency resolution happened. The exposedEntityManagerFactory/SessionFactoryproxy (which we have for other reasons already) could then simply delegate method invocations to aFutureof the target resource until it is known to be resolved, which is likely not to come before the very end of the startup phase.Issue Links:
Referenced from: commits db1171d, 09cea6e
1 votes, 9 watchers