From 56bd04b471269e26120ee58c38d413b91a055608 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 16 Sep 2014 17:26:10 -0700 Subject: [PATCH] Replaced more trx DIY with startAtomic() Change-Id: I76662aa438ed8aa294f8ec5973c9a51fd8b7cdbf --- includes/site/SiteSQLStore.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/includes/site/SiteSQLStore.php b/includes/site/SiteSQLStore.php index 944e9e261e..d133468053 100644 --- a/includes/site/SiteSQLStore.php +++ b/includes/site/SiteSQLStore.php @@ -392,18 +392,10 @@ class SiteSQLStore implements SiteStore { wfProfileIn( __METHOD__ ); $dbw = $this->sitesTable->getWriteDbConnection(); - $trx = $dbw->trxLevel(); - - if ( $trx == 0 ) { - $dbw->begin( __METHOD__ ); - } - + $dbw->startAtomic( __METHOD__ ); $ok = $dbw->delete( 'sites', '*', __METHOD__ ); $ok = $dbw->delete( 'site_identifiers', '*', __METHOD__ ) && $ok; - - if ( $trx == 0 ) { - $dbw->commit( __METHOD__ ); - } + $dbw->endAtomic( __METHOD__); $this->reset(); -- 2.20.1