Make doEditContent call $dbw->rollback() if exception happens
authorBrian Wolff <bawolff+wn@gmail.com>
Sun, 6 Apr 2014 03:16:37 +0000 (00:16 -0300)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 6 Apr 2014 02:38:09 +0000 (02:38 +0000)
commitf66ef1b7b2a64ad82c2f505711d92304279d6c16
treecfab47ace50bde74f92c63a6ca56cbcdf00c98cc
parentad937e5033e1d3449171ed27f3803bf149b7a2e8
Make doEditContent call $dbw->rollback() if exception happens

doEditContent calls a variety of methods in the middle of its
database transaction that can throw exceptions. For example if
$revision->insertOn() throws an exception, it can cause
referential integrity issues unless the transaction is rolled
back by something further up the chain (Thus see I5807e, I8f1da5).

It seems like it would be more reliable if doEditContent rolled
back its own transaction in exceptional circumstances. So this
patch puts everything in a try block, and does rollback if
an exception happens.

Bug: 63145
Bug: 32551
Change-Id: Icc44687da4edb1a72f13d2b95bfee2eea3ad6808
includes/WikiPage.php