This is the last caller in core that does a direct $dbw->begin()/commit() pair without exception for existing transactions. This should be fixed to avoid breaking existing transactions.
The begin/commit calls could be replaced and the code after them can use onTransactionIdle(). This would mean the post-commit updates would still be post-commit, though for cases were hooks/extensions cause multiple page edits, the ordering will change. It would go from:
BEGIN main edit updates 1 COMMIT post-commit updates 1 BEGIN (implicit COMMIT) main edit updates 2 COMMIT post-commit updates 2 (COMMIT)
...to something like:
BEGIN main edit updates 1 main edit updates 2 COMMIT post-commit updates 1 post-commit updates 2 (COMMIT)
A similar change was done to MovePage.php.