You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Borut Bolčina <bo...@najdi.si> on 2006/06/13 14:22:08 UTC

Deploying N application with N x 2 databases

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.

Regards,
Borut

Re: Deploying N application with N x 2 databases

Posted by Tore Halset <ha...@pvv.ntnu.no>.
On Tue, 13 Jun 2006, [UTF-8] Borut Bol?ina 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.

Are you using an app-server with jndi support? Take a look at 
JNDIDataSourceFactory.

http://objectstyle.org/confluence/display/CAYDOC/Using+JNDI

  - Tore.

Re: Deploying N application with N x 2 databases

Posted by Tomi NA <he...@gmail.com>.
On 6/13/06, Borut Bolčina <bo...@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.

RE: Deploying N application with N x 2 databases

Posted by "Gentry, Michael (Contractor)" <mi...@fanniemae.com>.
I did something similar: 1 server application connected to 6 identical
database schemas.  I have 6 DataNodes defined, though, but only 1
DataMap.  Documented here:

http://www.objectstyle.org/confluence/display/CAY/Copying+DataMaps

/dev/mrg


-----Original Message-----
From: Borut Bolcina [mailto:bob@najdi.si] 
Sent: Tuesday, June 13, 2006 8:22 AM
To: cayenne-user
Subject: Deploying N application with N x 2 databases


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.

Regards,
Borut