Made SiteSQLStore use startAtomic() instead of DIY
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 12 Sep 2014 22:58:40 +0000 (15:58 -0700)
committerReedy <reedy@wikimedia.org>
Tue, 16 Sep 2014 22:53:32 +0000 (22:53 +0000)
Change-Id: I3f47675646d772b4718086e2715e243da3a16bab

includes/site/SiteSQLStore.php

index 6659407..944e9e2 100644 (file)
@@ -314,11 +314,7 @@ class SiteSQLStore implements SiteStore {
 
                $dbw = $this->sitesTable->getWriteDbConnection();
 
-               $trx = $dbw->trxLevel();
-
-               if ( $trx == 0 ) {
-                       $dbw->begin( __METHOD__ );
-               }
+               $dbw->startAtomic( __METHOD__ );
 
                $success = true;
 
@@ -360,9 +356,7 @@ class SiteSQLStore implements SiteStore {
                        );
                }
 
-               if ( $trx == 0 ) {
-                       $dbw->commit( __METHOD__ );
-               }
+               $dbw->endAtomic( __METHOD__ );
 
                // purge cache
                $this->reset();