- protected function getSeparateMainLB() {
- global $wgDBtype;
-
- if ( $this->usesMainDB() && $wgDBtype !== 'sqlite' ) {
- if ( !$this->separateMainLB ) {
- // We must keep a separate connection to MySQL in order to avoid deadlocks
- $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
- $this->separateMainLB = $lbFactory->newMainLB();
- }
- return $this->separateMainLB;
- } else {
- // However, SQLite has an opposite behavior due to DB-level locking
- return null;
- }
- }
-