A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
Object Relational Mapping
Two session-factory in one hibernate.cfg.xml
Joined: Sep 14, 2004
Feb 01, 2007 06:33:00
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.
Joined: Apr 14, 2004
Feb 01, 2007 07:20:00
Have a look at the
- only one session-factory element is allowed in a hibernate-configuration. So you'll need two config files.
I agree. Here's the link:
subject: Two session-factory in one hibernate.cfg.xml
Multiple Database Connections with Hibernate 3
having two hibernate.cfg.xml on the same project
How internally works
Best Method for the Singleton Design Pattern
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014