Forum OpenACS Q&A: Re: Ran out of database pools (pool2 pool3 pool1)

Collapse
Posted by Don Baccus on
You are right about transaction semantics, but it doesn't matter typically if you're doing nested SELECTs to display data in a table, which is why people typically nest db_foreach.

This doesn't making nesting them a good idea, but it doesn't make nesting them particularly dangerous either. Just not the right way to write queries to display data.

All db_* API procs grab handles automatically, and there are many cases where it makes perfectly good sense to do so. Shipping OpenACS defaulted to one pool would break a large amount of perfectly well-behaved code.

Hm. I forgot about the (probably more typical?) cases where a proc several call layers deep might grab a 2nd handle to do some totally unrelated query, as opposed to the db_foreach case. (Better than the old days 3.x days of having to always refactor code to pass in the db handle.) That's probably why only enabling one db pool would break lots of stuff?