Forum OpenACS Q&A: Response to db_foreach in transactions

Posted by Dan Wickstrom on
There really is no work around other than restructuring the code.  As you suggested, you could build a list and then use foreach.  It's just not possible to have multiple handles active within a transaction - at least within TCL.  The problem arises from how the db drivers are implemented (both oracle and postgresql have this limitation), and my understanding is that it's not something that is easy to fix.

Another possibility is to move the code to pl/sql, as there are no limitations on the number of active handles when using the db procedural languages.