• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to create more then one Session Factory

 
vipin jain
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i create and use more than one SessionFactory in one cfg file or different cfg file?
can we create any name of cfg file insted of hibernate.cfg.xml?

please explain me with example.....
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to manually configure the SessionFactory, rather than relying on the default behaviour Hibernate provides. If you look at the JavaDocs you'll see that the Configuration class has multiple configure methods, many of which allow you to specify the resource you use to configure your SessionFactory.
 
vipin jain
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul,
CAN YOU PLEASE SEND ME JAVAdOC URL;
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All the documentation is available on the Hibernate website
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic