From 820f5d6ce57f2459dafa9b6f3f35eb9d67458971 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 21 Jul 2016 00:05:22 -0700 Subject: [PATCH] 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 --- includes/db/Database.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/db/Database.php b/includes/db/Database.php index 3dc6e9213b..ba25183e46 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -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(); -- 2.20.1