From: Aaron Schulz Date: Sat, 27 Jul 2019 09:08:06 +0000 (-0400) Subject: externalstore: use CONN_TRX_AUTOCOMMIT instead of IDatabase::clearFlag() X-Git-Tag: 1.34.0-rc.0~850^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=92412c166bbbb293a9968588e5e21f9c803b1904;p=lhc%2Fweb%2Fwiklou.git externalstore: use CONN_TRX_AUTOCOMMIT instead of IDatabase::clearFlag() Change-Id: I8984623d3ff67d305597f05c596c2777c2c117e0 --- diff --git a/includes/externalstore/ExternalStoreDB.php b/includes/externalstore/ExternalStoreDB.php index 4d70d66f10..4db351b25b 100644 --- a/includes/externalstore/ExternalStoreDB.php +++ b/includes/externalstore/ExternalStoreDB.php @@ -154,12 +154,13 @@ class ExternalStoreDB extends ExternalStoreMedium { */ public function getSlave( $cluster ) { $lb = $this->getLoadBalancer( $cluster ); - $domainId = $this->getDomainId( $lb->getServerInfo( $lb->getWriterIndex() ) ); - - $db = $lb->getConnectionRef( DB_REPLICA, [], $domainId ); - $db->clearFlag( DBO_TRX ); // sanity - return $db; + return $lb->getConnectionRef( + DB_REPLICA, + [], + $this->getDomainId( $lb->getServerInfo( $lb->getWriterIndex() ) ), + $lb::CONN_TRX_AUTOCOMMIT + ); } /** @@ -170,12 +171,13 @@ class ExternalStoreDB extends ExternalStoreMedium { */ public function getMaster( $cluster ) { $lb = $this->getLoadBalancer( $cluster ); - $domainId = $this->getDomainId( $lb->getServerInfo( $lb->getWriterIndex() ) ); - - $db = $lb->getMaintenanceConnectionRef( DB_MASTER, [], $domainId ); - $db->clearFlag( DBO_TRX ); // sanity - return $db; + return $lb->getMaintenanceConnectionRef( + DB_MASTER, + [], + $this->getDomainId( $lb->getServerInfo( $lb->getWriterIndex() ) ), + $lb::CONN_TRX_AUTOCOMMIT + ); } /**