-->
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.  [ 4 posts ] 
Author Message
 Post subject: Multiple hibernate.cfg.xml files
PostPosted: Mon May 24, 2004 5:08 pm 
Beginner
Beginner

Joined: Thu Feb 05, 2004 10:39 pm
Posts: 44
I am working with a larger application that will be deployed as multiple ears and jars which can either operate independently or in unisom. There is one shared framework.jar which all modules use as a foundation.

Currently, each module has its own hibernate.cfg.xml file and its own set of hibernate mappings. The foundation framework.jar also has its own config and mappings file. The fremework.jar is included in each module.

The problem I am running into is that hibernate will load the first hibernate.cfg.xml file it comes across, load the mapping files defined there and stop at that.

What I would like is for hibernate to load the appropriate hibernate.cfg.xml file for the module which calls it. Now, can this be done dynamically somehow or do I have to explicitly pass hibernate.cfg.xml into the configure method of SessionFactory?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 24, 2004 5:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Either isolate the classloaders or pass the hibernate.cfg.xml manually to the configuration.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 24, 2004 5:26 pm 
Beginner
Beginner

Joined: Thu Feb 05, 2004 10:39 pm
Posts: 44
ok, if I want to switch everything over to use JNDI registered SessionFactories, should I then define a separate JNDI entry and SessionFactory for each module?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 28, 2004 8:59 am 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
Exactly!


Sherman


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.