-->
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.  [ 5 posts ] 
Author Message
 Post subject: How Can I use two config files?
PostPosted: Tue Nov 01, 2005 7:00 am 
Newbie

Joined: Tue Nov 01, 2005 6:38 am
Posts: 4
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs: No appear

Name and version of the database you are using:SqlServer

The generated SQL (show_sql=true): true

Debug level Hibernate log excerpt:


I'm using the JAAS to autentication and autorization of the system. In JAAS's class I'm using the hibernate because I need get the roles in database. Then I have one config file of hibernate to get the roles and the other config file from the principal system. The hibernate load the first config file (config file JAAS), but when the system try access the class of the principal system, the hibernate didn't find the other config file. Therefore, the principal system didn't get anyone object(rows).

How can I use two config files or resolve this problem?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 01, 2005 7:26 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Code:
Configuration configuration = new Configuration();
configuration.add("file1.xml");
configuration.configure("file2.xml");


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 01, 2005 11:58 am 
Newbie

Joined: Tue Nov 01, 2005 6:38 am
Posts: 4
I can load the other file, but the datasource didn't change. Witch file have different datasource. How can I change the datasource in runtime?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 01, 2005 12:05 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
Quote:
I can load the other file, but the datasource didn't change. Witch file have different datasource. How can I change the datasource in runtime?


do you need to rebuild the sessionFactory

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 01, 2005 2:42 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
if you want two datasources at same time you have to build two sessionFactory's


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