-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: how to handle Multiple hibernate.cfg.xml files
PostPosted: Tue Aug 21, 2007 5:02 pm 
Newbie

Joined: Tue Aug 14, 2007 1:13 pm
Posts: 2
Is it possible to have Multiple hibernate.cfg.xml files in the same application (ear)? I have a pre-built ear(this cannot be modified), I written some addtional functionality (a jar) which uses hibernate for db access. When bundled together and deployed(in the same jvm) it seems to be having problem picking up the configuration.

Any Ideas.
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 21, 2007 6:15 pm 
Newbie

Joined: Wed Aug 24, 2005 1:43 pm
Posts: 10
you can have many hibernate.cfg.xml files. you can for example use different names

Configuration cfg = new Configuration();
cfg.configure("hibernate-A.cfg.xml");
...
Configuration cfg = new Configuration();
cfg.configure("hibernate-B.cfg.xml");

or you can provide a special ClassLoader that knows where to pick the correct one.

cheers,
Seb


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.