-->
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.  [ 1 post ] 
Author Message
 Post subject: Multiple hibernate.properties for different projects
PostPosted: Tue Jan 20, 2009 12:01 pm 
Newbie

Joined: Tue Jan 15, 2008 6:26 am
Posts: 8
Hibernate version:
3.3.1.GA

Hi,

I am currently facing the following problems.
I am running multiple Hibernate-based applications on one application server. As I have multiple different environments for my application (such as integration, live, etc) I am using the hibernate.properties to configure hibernate properties, so that I keep one single jar together with different DB-settings.

So far so good.
But now I want to run a second Hibernate-based application on that server, which also holds it´s own hibernate.properties for it´s configuration. But the problem is, that this file now is completely ignored and furthermore the hibernate.properties from the first application is used as well.

When looking into the source code of the Environment-Class the reason becomes obvious as the accordant variable is declared as static:

Code:
private static final Properties GLOBAL_PROPERTIES;


As far as I can see this class will only be called once, so the second application does not start an own instance of the Environment itself, but uses the existing one.

Is there any chance to define hibernate.properties for each application independantly?

Any input is greatly appriciated...

Thomas


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

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.