• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Creating multiple/single SessionFactory  RSS feed

Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand that creation of session factory is expensive operation. Now assuming that i have an application1 with 10 java bean that are persisted in db and application2 with 100 java beans to be persisted.

In the application1 hibernate1.cfg.xml i have specified the mapping of all the 10 java bean and in application2 hibernate2.cfg.xml i have specified the mapping of all the 100 java beans.

Now in application1, i create a session factory sf1 and in application2 i create a session factory sf2.

Does creation of sf1 requires same amount of resources and is as "expensive" as creation of sf2.

I am trying to figure this out as i have multiple db instance, and multiple session factories are created. I want to merge all these db instance to reduce the overhead of creation of multiple session factories.

Please advise
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!