Self-revert and re-add transactions here. Sacrifices some atomicity for less transact...
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 24 Sep 2008 18:00:25 +0000 (18:00 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 24 Sep 2008 18:00:25 +0000 (18:00 +0000)
includes/Article.php

index 06e3ecd..5962d69 100644 (file)
@@ -1570,6 +1570,7 @@ class Article {
                        $this->mGoodAdjustment = (int)$this->isCountable( $text );
                        $this->mTotalAdjustment = 1;
 
+                       $dbw->begin();
                        # Add the page record; stake our claim on this title!
                        # This will fail with a database query exception if the article already exists
                        $newid = $this->insertOn( $dbw );
@@ -1601,6 +1602,7 @@ class Article {
                                }
                        }
                        $user->incEditCount();
+                       $dbw->commit();
 
                        # Update links, etc.
                        $this->editUpdates( $text, $summary, $isminor, $now, $revisionId, true );