From 07e7a9c94494c1db2794a8965459b14e6edacc41 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 12 Jul 2012 16:50:48 -0400 Subject: [PATCH] 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 --- includes/DataUpdate.php | 4 ++++ includes/SqlDataUpdate.php | 5 +++++ 2 files changed, 9 insertions(+) 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 { -- 2.20.1