r109136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109135‎ | r109136 | r109137 >
Date:11:38, 17 January 2012
Author:ialex
Status:ok
Tags:
Comment:
Pass __METHOD__ to DatabaseBase::begin() and DatabaseBase::commit()
Modified paths:
  • /trunk/phase3/includes/objectcache/SqlBagOStuff.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/objectcache/SqlBagOStuff.php
@@ -133,7 +133,7 @@
134134 if ( $this->isExpired( $row->exptime ) ) {
135135 $this->debug( "get: key has expired, deleting" );
136136 try {
137 - $db->begin();
 137+ $db->begin( __METHOD__ );
138138 # Put the expiry time in the WHERE condition to avoid deleting a
139139 # newly-inserted value
140140 $db->delete( $tableName,
@@ -141,7 +141,7 @@
142142 'keyname' => $key,
143143 'exptime' => $row->exptime
144144 ), __METHOD__ );
145 - $db->commit();
 145+ $db->commit( __METHOD__ );
146146 } catch ( DBQueryError $e ) {
147147 $this->handleWriteError( $e );
148148 }
@@ -170,7 +170,7 @@
171171 $encExpiry = $db->timestamp( $exptime );
172172 }
173173 try {
174 - $db->begin();
 174+ $db->begin( __METHOD__ );
175175 // (bug 24425) use a replace if the db supports it instead of
176176 // delete/insert to avoid clashes with conflicting keynames
177177 $db->replace(
@@ -181,7 +181,7 @@
182182 'value' => $db->encodeBlob( $this->serialize( $value ) ),
183183 'exptime' => $encExpiry
184184 ), __METHOD__ );
185 - $db->commit();
 185+ $db->commit( __METHOD__ );
186186 } catch ( DBQueryError $e ) {
187187 $this->handleWriteError( $e );
188188
@@ -195,12 +195,12 @@
196196 $db = $this->getDB();
197197
198198 try {
199 - $db->begin();
 199+ $db->begin( __METHOD__ );
200200 $db->delete(
201201 $this->getTableByKey( $key ),
202202 array( 'keyname' => $key ),
203203 __METHOD__ );
204 - $db->commit();
 204+ $db->commit( __METHOD__ );
205205 } catch ( DBQueryError $e ) {
206206 $this->handleWriteError( $e );
207207
@@ -216,7 +216,7 @@
217217 $step = intval( $step );
218218
219219 try {
220 - $db->begin();
 220+ $db->begin( __METHOD__ );
221221 $row = $db->selectRow(
222222 $tableName,
223223 array( 'value', 'exptime' ),
@@ -225,14 +225,14 @@
226226 array( 'FOR UPDATE' ) );
227227 if ( $row === false ) {
228228 // Missing
229 - $db->commit();
 229+ $db->commit( __METHOD__ );
230230
231231 return null;
232232 }
233233 $db->delete( $tableName, array( 'keyname' => $key ), __METHOD__ );
234234 if ( $this->isExpired( $row->exptime ) ) {
235235 // Expired, do not reinsert
236 - $db->commit();
 236+ $db->commit( __METHOD__ );
237237
238238 return null;
239239 }
@@ -250,7 +250,7 @@
251251 // Race condition. See bug 28611
252252 $newValue = null;
253253 }
254 - $db->commit();
 254+ $db->commit( __METHOD__ );
255255 } catch ( DBQueryError $e ) {
256256 $this->handleWriteError( $e );
257257
@@ -346,7 +346,7 @@
347347 $maxExpTime = $row->exptime;
348348 }
349349
350 - $db->begin();
 350+ $db->begin( __METHOD__ );
351351 $db->delete(
352352 $this->getTableByShard( $i ),
353353 array(
@@ -355,7 +355,7 @@
356356 'keyname' => $keys
357357 ),
358358 __METHOD__ );
359 - $db->commit();
 359+ $db->commit( __METHOD__ );
360360
361361 if ( $progressCallback ) {
362362 if ( intval( $totalSeconds ) === 0 ) {
@@ -384,9 +384,9 @@
385385
386386 try {
387387 for ( $i = 0; $i < $this->shards; $i++ ) {
388 - $db->begin();
 388+ $db->begin( __METHOD__ );
389389 $db->delete( $this->getTableByShard( $i ), '*', __METHOD__ );
390 - $db->commit();
 390+ $db->commit( __METHOD__ );
391391 }
392392 } catch ( DBQueryError $e ) {
393393 $this->handleWriteError( $e );
@@ -464,12 +464,12 @@
465465 }
466466
467467 for ( $i = 0; $i < $this->shards; $i++ ) {
468 - $db->begin();
 468+ $db->begin( __METHOD__ );
469469 $db->query(
470470 'CREATE TABLE ' . $db->tableName( $this->getTableByShard( $i ) ) .
471471 ' LIKE ' . $db->tableName( 'objectcache' ),
472472 __METHOD__ );
473 - $db->commit();
 473+ $db->commit( __METHOD__ );
474474 }
475475 }
476476 }

Status & tagging log