ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A. Zeneski" <...@ofbiz.org>
Subject Re: Using an alternative delegator
Date Fri, 27 Oct 2006 14:19:16 GMT
Your best bet to to override the definition of the default delegator.  
The easiest way to do this is by editing entityengine.xml and  
pointing it to a different datasource.

One way to accomplish this is by writing a new startup script which  
renames the entityengine.xml file to the one you want.

1) Create 3 different configurations: entityengine-production.xml,  
entityengine-training.xml, entityengine-testing.xml and configure each.

2) Create a script mystartofbiz.sh which either takes a parameter to  
know which one to use i.e. training

- cp entityengine-$1.xml entityengine.xml
- use the code to actually start the program.
- invoke your script ./mystartofbiz.sh production

This would be the easiest, and safest method right now.

Andy

On Oct 26, 2006, at 8:08 PM, Iain Fogg wrote:

> I know it is possible to use an alternative delegator when  
> installing the OFBiz database and seed data (using the -delegator  
> switch).
>
> Does anyone know how/if I can point to the application itself at a  
> different delegator.
>
> Scenario:
>
> I have 3 separate datasources: production, training, and demo
>
> Normally, I'd want the production datasource, and so it is  
> configured as the default delegator in entitymodel.xml. On occasion  
> I want to run against the training DB for (you guessed it)  
> training, and against the demo DB to check whether problems might  
> be caused by my configuration or code bugs.
>
> What I'd love to do is something like
>
> java -jar ofbiz.jar -delegator=training
>
> to run a training session. When I try to do this, it barfs telling  
> me it can't load configuration properties in org/ofbiz/base/start/ 
> delegator=training.properties. Would it be as simple as finding a  
> template for this properties file (presumably default.properties,  
> but I couldn't find that), and modifying it accordingly. I saw some  
> JIRA posts that seemed to imply that some of the code assumes we  
> are using the default delegator, so I might be going down a dead- 
> end trying to do this.
>
> Advice appreciated.
>
> Cheers, Iain
>
>
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.408 / Virus Database: 268.13.13/500 - Release Date:  
> 26/10/2006
>


Mime
View raw message