Forum OpenACS Q&A: db pools with the 4.x api

Collapse
Posted by Jonathan Ellis on
how does splitting db handles available into separate pools affect
the 4.x db api?  It looks like "subquery" and "log" pools really
aren't limited to that... db_nth_pool_name just picks succeeding
pools for nested statments, so what we have is "top level" "1st
nested" and "2nd nested" in the example nsd conf.  Right?
Collapse
Posted by Don Baccus on
My pools are named "pool1", "pool2", "pool3" in all my installs.  You don't need a default pool, either (you do with ACS Classic 4.x, though).

If you define a list of named "availpool"s it will only use those, very useful if you're talking to another database (migrating from 3.x to 4.x, for instance, or talking to a non-ACS database containing stuff you need).

Thus far I haven't seen any instance of needing more than three pools.

Collapse
Posted by Michael A. Cleverly on
The number of pools you define equals the depth you can nest calls to the db_* api. So, with three pools, you could have:
    db_foreach A { ... } {
        db_foreach B { ... } {
            db_foreach C { ... } {
                # but not db_foreach D { ... }
            }
        }
    }