Forum OpenACS Q&A: Re: 2nd database

Collapse
4: Re: 2nd database (response to 1)
Posted by Steve Manning on
We use the dbn switch that Andrew mentioned on a live site and it works very well.

These are our config settings:


ns_section "ns/server/${server}/acs/database"
ns_param database_names  [list main rohde]
ns_param pools_main      [list pool1 pool2 pool3]
ns_param pools_rohde     [list rohde_pool]

  
ns_section ns/db/pools
ns_param   pool1              "Pool 1"
ns_param   pool2              "Pool 2"
ns_param   pool3              "Pool 3"
ns_param   rohde_pool         "Rohde Databox"

# --- Pool for Rohde Databox ---
ns_section ns/db/pool/rohde_pool
ns_param   maxidle            1000000000
ns_param   maxopen            1000000000
ns_param   connections        5
ns_param   verbose            $debug
ns_param   extendedtableinfo  true
ns_param   logsqlerrors       $debug
ns_param   driver             postgres
ns_param   datasource         10.8.1.1:5432:rohde
ns_param   user               xxxxxx
ns_param   password           xxxxxx
                                                                                                                            

Then when we need to access the rohde db we use:

db_foreach -dbn rohde ...
i.e the name from the database_names setting which points to the connection pools available for that database.

Hope this helps.

- Steve