Mediawiki throws this notice whenever there isn't a matching commit/rollback instruction after a begin transaction has been issued.
To my understanding, this notice should be **for developers only**, and should never hit production users. However, [[ https://www.google.com/search?q=%22Uncommitted+DB+writes%22 | this is not the case ]].
The problem with this notice is that it often pops when there's another PHP exception, that is thrown, leaving an unclosed transaction, and **this notice hides the real exception**, making debugging more hard. For whatever reason, many users hitting this situation only get the //Uncommitted DB writes// error. See also T58269, T67205, T85734, T69842, where you can find examples where the real error message is completely hidden. This makes very difficult for anyone trying to help those users.
My proposal is:
- Don't throw this notice unless [[ https://www.mediawiki.org/wiki/Manual:$wgDevelopmentWarnings | $wgDevelopmentWarnings ]] is set to true.
- Don't throw this notice if there has been a previous exception, to prevent hiding the real one. Maybe [[ http://php.net/error-get-last | error_get_last() ]] could be used for this purpose?