Topic: cancel_transaction (not really a bug)
I'm just familiarizing myself with the code before I get started on a rather major extension ...
In /includes/db/sql_functions.inc, there is a function called "cancel_transaction". I'm not sure if or when that is called, but if it were called inside of nested calls to begin/commit transaction calls and any function called "commit", the global $transaction_level would go to -1, which would cause all following begin/commit calls to be ignored.
I could be missing something, and maybe the cancel is never called, but I can imagine some additional checks to be sure that $transaction_level never goes negative. I'm not here to criticize something I don't completely understand. I just thought someone might want to consider this as a source of some unpredictable behavior, as, once the global was out of range, all subsequent "transactions" would actually not be done as transactions.