Tell people not to start transactions in doUpdate.
authordaniel <daniel.kinzler@wikimedia.de>
Thu, 12 Jul 2012 20:50:48 +0000 (16:50 -0400)
committerdaniel <daniel.kinzler@wikimedia.de>
Thu, 12 Jul 2012 20:56:07 +0000 (16:56 -0400)
DataUpdate::runUpdates() object handle transations automatically,
code in doUpdate should not interfere with that.

Change-Id: I7575e1b77d58921813af24e015edb03cad5fdb3a

includes/DataUpdate.php
includes/SqlDataUpdate.php

index 7203c3b..793d335 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 {
 
index 6d36a43..aeb9ba4 100644 (file)
 /**
  * Abstract base class for update jobs that put some secondary data extracted
  * from article content into the database.
+ *
+ * @note: subclasses should NOT start or commit transactions in their doUpdate() method,
+ *        a transaction will automatically be wrapped around the update. Starting another
+ *        one would break the outer transaction bracket. If need be, subclasses can override
+ *        the beginTransaction() and commitTransaction() methods.
  */
 abstract class SqlDataUpdate extends DataUpdate {