Upgrade premature implicit transaction commits to exceptions

DBO_TRX transactions for the web request are now enforced.
WMF logs for implicit commit warnings are now silent after
the last round of patches.

Change-Id: If91633d192bfd9e137f8f868230d5040dea0ad45
This commit is contained in:
Aaron Schulz 2016-07-21 00:05:22 -07:00
parent 277a233fc6
commit 820f5d6ce5

View file

@ -2642,13 +2642,13 @@ abstract class DatabaseBase implements IDatabase {
"$fname: Transaction already in progress (from {$this->mTrxFname}), " .
" performing implicit commit!"
);
} else {
} elseif ( $this->mTrxDoneWrites ) {
// The transaction was automatic and has done write operations
if ( $this->mTrxDoneWrites ) {
wfLogDBError( "$fname: Automatic transaction with writes in progress" .
throw new DBUnexpectedError(
$this,
"$fname: Automatic transaction with writes in progress" .
" (from {$this->mTrxFname}), performing implicit commit!\n"
);
}
);
}
$this->runOnTransactionPreCommitCallbacks();