/**
* @param ILoadBalancer $dbLoadBalancer A load balancer for acquiring database connections
* @param WANObjectCache $cache A cache manager for caching data. This can be the local
- * wiki's default instance even if $wikiId refers to a different wiki, since
+ * wiki's default instance even if $dbDomain refers to a different wiki, since
* makeGlobalKey() is used to constructed a key that allows cached names from
* the same database to be re-used between wikis. For example, enwiki and frwiki will
* use the same cache keys for names from the wikidatawiki database, regardless
* @return IDatabase
*/
private function getDBConnection( $index, $flags = 0 ) {
- return $this->loadBalancer->getConnection( $index, [], $this->domain, $flags );
+ return $this->loadBalancer->getConnectionRef( $index, [], $this->domain, $flags );
}
/**
if ( $id === null ) {
// RACE: $name was already in the db, probably just inserted, so load from master.
// Use DBO_TRX to avoid missing inserts due to other threads or REPEATABLE-READs.
- // ...but not during unit tests, because we need the fake DB tables of the default
- // connection.
- $connFlags = defined( 'MW_PHPUNIT_TEST' ) ? 0 : ILoadBalancer::CONN_TRX_AUTOCOMMIT;
- $table = $this->reloadMap( $connFlags );
+ $table = $this->reloadMap( ILoadBalancer::CONN_TRX_AUTOCOMMIT );
$searchResult = array_search( $name, $table, true );
if ( $searchResult === false ) {