$this->res = false;
$dbw = wfGetDB( DB_MASTER );
$this->doQuery( $dbw );
- $dbw->begin( __METHOD__ );
+ $dbw->startAtomic( __METHOD__ );
$status = Status::newGood();
$missing = array_flip( $this->ids );
$this->clearFileOps();
'authorIds' => $authorIds,
'authorIPs' => $authorIPs
) );
- $dbw->commit( __METHOD__ );
// Clear caches
- $status->merge( $this->doPostCommitUpdates() );
+ $that = $this;
+ $dbw->onTransactionIdle( function() use ( $that ) {
+ $that->doPostCommitUpdates();
+ } );
+
+ $dbw->endAtomic( __METHOD__ );
+
return $status;
}