Can I configure Hibernate to lazy initialize the SessionFactory or can I cache the SessionFactory?

Solution Verified - Updated -

Issue

  • We use a combination of spring and hibernate. On app startup, the spring context initializes and it in turn initializes hibernate. I'm trying so speed up the initialzing of hibernate. Is there a way to set it so that hibernate only initiazes classes as it needs them?
  • Can I cache multiple SessionFactories generated at runtime?

Environment

  • Spring (not necessary here)

  • Hibernate 3.2.3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content