Revert r40752. Causes lock contention on site_stats and other tracking tables, probab...
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 21 Sep 2008 07:56:09 +0000 (07:56 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 21 Sep 2008 07:56:09 +0000 (07:56 +0000)
includes/Article.php

index 9c382f6..7b41a08 100644 (file)
@@ -1475,9 +1475,8 @@ class Article {
                        $lastRevision = 0;
                        $revisionId = 0;
 
-                       $dbw->begin();
-
                        $changed = ( strcmp( $text, $oldtext ) != 0 );
+
                        if ( $changed ) {
                                $this->mGoodAdjustment = (int)$this->isCountable( $text )
                                  - (int)$this->isCountable( $oldtext );
@@ -1503,6 +1502,7 @@ class Article {
                                        'user_text'  => $user->getName(),
                                        ) );
 
+                               $dbw->begin();
                                $revisionId = $revision->insertOn( $dbw );
 
                                # Update page
@@ -1527,6 +1527,7 @@ class Article {
                                                }
                                        }
                                        $user->incEditCount();
+                                       $dbw->commit();
                                }
                        } else {
                                $revision = null;
@@ -1547,7 +1548,6 @@ class Article {
                                Article::onArticleEdit( $this->mTitle, false ); // leave templatelinks for editUpdates()
                                # Update links tables, site stats, etc.
                                $this->editUpdates( $text, $summary, $isminor, $now, $revisionId, $changed );
-                               $dbw->commit();
                        }
                } else {
                        # Create new article