• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can we Write more than 2 hibernate.cfg.xml's?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can we Write more than 2 hibernate.cfg.xml's?
If yes, How to add sessions? please give with exampls?
 
Barry Van
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This code rite? please check..if wrong.. how can we use 2 cfg.xml's?

Configuration cfg = new Configuration();
cfg.addFile("hibernate.cfg.xml");
cfg.addFile("hibernate2.cfg.xml");

sessionFactory = cfg.buildSessionFactory();
 
Barry Van
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Please any one resolve the above Issues..
 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think that is possible.
Look at the below code. Hope that might be of some help.
 
Barry Van
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Please check this code.. Is it write..?
Is it Possible to use morethan one cfg xmls?

Configuration cfg = new Configuration();
cfg.configure("hibernate1.cfg.xml");
cfg.configure("hibernate2.cfg.xml");
// sessionFactory = new Configuration().configure().buildSessionFactory();
sessionFactory = cfg.buildSessionFactory();
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic