To have a generic solution there is now a sql_buffer_nested_transaction() which indicates that the given SQL driver requires buffering to run a transaction while iterating over another result set. PHPBB3-9685