From a883b5e91f3d35b96ba9ee04fbf54d15df085b88 Mon Sep 17 00:00:00 2001 From: aude Date: Mon, 5 Nov 2012 20:57:47 +0100 Subject: [PATCH] make ORMRow compatible with load balancer, replace usage of wfGetDB( DB_MASTER ) Change-Id: Ic9e728f8d2f83906fee6c4877296ad0759a7b539 --- includes/db/ORMRow.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/db/ORMRow.php b/includes/db/ORMRow.php index fa25868d7a..1753afe115 100644 --- a/includes/db/ORMRow.php +++ b/includes/db/ORMRow.php @@ -347,7 +347,7 @@ abstract class ORMRow implements IORMRow { * @return boolean Success indicator */ protected function saveExisting( $functionName = null ) { - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->table->getWriteDbConnection(); $success = $dbw->update( $this->table->getName(), @@ -383,7 +383,7 @@ abstract class ORMRow implements IORMRow { * @return boolean Success indicator */ protected function insert( $functionName = null, array $options = null ) { - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->table->getWriteDbConnection(); $success = $dbw->insert( $this->table->getName(), @@ -558,7 +558,7 @@ abstract class ORMRow implements IORMRow { $absoluteAmount = abs( $amount ); $isNegative = $amount < 0; - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->table->getWriteDbConnection(); $fullField = $this->table->getPrefixedField( $field ); -- 2.20.1