cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomi NA" <hef...@gmail.com>
Subject Re: Deploying N application with N x 2 databases
Date Tue, 13 Jun 2006 12:42:51 GMT
On 6/13/06, Borut BolĨina <bob@najdi.si> wrote:
> What is the best (most elegant) solution to deploy standalone
> application on several servers each using two databases. I don't want to
> manually correct DomainMap (and DomainNode.driver) on each server to
> point to correct database.
>
> Databases A1..AN and B1..BN are identical, only data varies.
>
> server1:application:database_A1,database_B1
> server2:application:database_A2,database_B2
> ...
> serverN:application:database_AN,database_BN
>
> Should I create N DataNodes in modeler? Any hints appreciated.

There's an simpler way. This will e.g. generate 4 example Node definitions:

$ for db in dbname1 dbname2 dbname3 dbname4; do cat
cayenneNode.driver.xml  | sed
"s/\(.*\)\/initialDbName\(.*\)/\1\/$db\2/g" > ${db}Node.driver..xml;
done

You could do the same to generate N cayenne.xml files, placing each
file (with it's respective node and mapping files in individual
directories, named dbname1, dbname2 etc.
The only assumption is that you have a UNIX shell within reach and are
ready to use it. :)

Cheers,
t.n.a.
Mime
View raw message