This conditionally uses again the ILoadBalancer::CONN_TRX_AUTOCOMMITflag, so it might be a bit unusual, but is already used in other contexts for example: https://github.com/wikimedia/Wikibase/blob/b6f6aaef23f28e163f0453fc5d6e9448b6367b5b/lib/includes/Store/Sql/Terms/Util/ReplicaMasterAwareRecordIdsAcquirer.php#L194
$flags = ( $this->separateDbConnection === true ) ? ILoadBalancer::CONN_TRX_AUTOCOMMIT : 0; $database = $this->loadBalancer->getConnection( DB_PRIMARY, [], false, $flags );