From: daniel Date: Thu, 12 Jul 2012 20:50:48 +0000 (-0400) Subject: Tell people not to start transactions in doUpdate. X-Git-Tag: 1.31.0-rc.0~23062 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=07e7a9c94494c1db2794a8965459b14e6edacc41;p=lhc%2Fweb%2Fwiklou.git Tell people not to start transactions in doUpdate. DataUpdate::runUpdates() object handle transations automatically, code in doUpdate should not interfere with that. Change-Id: I7575e1b77d58921813af24e015edb03cad5fdb3a --- diff --git a/includes/DataUpdate.php b/includes/DataUpdate.php index 7203c3b3c3..793d335b2a 100644 --- a/includes/DataUpdate.php +++ b/includes/DataUpdate.php @@ -24,6 +24,10 @@ /** * 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 { diff --git a/includes/SqlDataUpdate.php b/includes/SqlDataUpdate.php index 6d36a439ed..aeb9ba4c7f 100644 --- a/includes/SqlDataUpdate.php +++ b/includes/SqlDataUpdate.php @@ -24,6 +24,11 @@ /** * 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 {