Replaced more trx DIY with startAtomic()
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 17 Sep 2014 00:26:10 +0000 (17:26 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 17 Sep 2014 00:26:10 +0000 (17:26 -0700)
Change-Id: I76662aa438ed8aa294f8ec5973c9a51fd8b7cdbf

includes/site/SiteSQLStore.php

index 944e9e2..d133468 100644 (file)
@@ -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();