This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two session-factory in one hibernate.cfg.xml

 
himaunshu shah
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to access two databases. I know this can be achieved by creating two
XML configuration files and creating two Configuration and SessionFactory objects in the application.

But is it possible to have two session-factoy tags in one hibernate.cfg.xml? If yes, then what should be the format of the cfg.cml and how to access two SessionFactory objects.

Thanks in advance.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the DTD - only one session-factory element is allowed in a hibernate-configuration. So you'll need two config files.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic