Fix flush-like commit in DeferredUpdates.
[lhc/web/wiklou.git] / includes / DataUpdate.php
index 7203c3b..088bb7e 100644 (file)
 /**
  * Abstract base class for update jobs that do something with some secondary
  * data extracted from article.
+ *
+ * @note: subclasses should NOT start or commit transactions in their doUpdate() method,
+ *        a transaction will automatically be wrapped around the update. If need be,
+ *        subclasses can override the beginTransaction() and commitTransaction() methods.
  */
 abstract class DataUpdate implements DeferrableUpdate {
 
@@ -72,6 +76,7 @@ abstract class DataUpdate implements DeferrableUpdate {
         *
         * @static
         * @param $updates array a list of DataUpdate instances
+        * @throws Exception|null
         */
        public static function runUpdates( $updates ) {
                if ( empty( $updates ) ) return; # nothing to do
@@ -80,8 +85,8 @@ abstract class DataUpdate implements DeferrableUpdate {
                $exception = null;
 
                /**
-                * @var $update StorageUpdate
-                * @var $trans StorageUpdate
+                * @var $update DataUpdate
+                * @var $trans DataUpdate
                 */
 
                try {