* This avoids an explicit commit of an implicit transaction when the site
config for the ES cluster does not clear that flag by mistake.
Change-Id: I57d8b04cbf3249849db1643fc82673e9de8ea15b
if ( !$id ) {
throw new MWException( __METHOD__ . ': no insert ID' );
}
if ( !$id ) {
throw new MWException( __METHOD__ . ': no insert ID' );
}
- if ( $dbw->getFlag( DBO_TRX ) ) {
- $dbw->commit( __METHOD__ );
- }
return "DB://$cluster/$id";
}
return "DB://$cluster/$id";
}
wfDebug( "writable external store\n" );
}
wfDebug( "writable external store\n" );
}
- return $lb->getConnection( DB_SLAVE, array(), $wiki );
+ $db = $lb->getConnection( DB_SLAVE, array(), $wiki );
+ $db->clearFlag( DBO_TRX ); // sanity
+
+ return $db;
$wiki = isset( $this->params['wiki'] ) ? $this->params['wiki'] : false;
$lb = $this->getLoadBalancer( $cluster );
$wiki = isset( $this->params['wiki'] ) ? $this->params['wiki'] : false;
$lb = $this->getLoadBalancer( $cluster );
- return $lb->getConnection( DB_MASTER, array(), $wiki );
+ $db = $lb->getConnection( DB_MASTER, array(), $wiki );
+ $db->clearFlag( DBO_TRX ); // sanity
+
+ return $db;
+ /**
+ * @param string $url
+ * @return array
+ */
protected function parseURL( $url ) {
$path = explode( '/', $url );
protected function parseURL( $url ) {
$path = explode( '/', $url );