* @access private
*/
function reallyOpenConnection( &$server ) {
- wfProfileIn( __METHOD__ );
if( !is_array( $server ) ) {
- wfProfileOut( __METHOD__ );
throw new MWException( 'You must update your load-balancing configuration. See DefaultSettings.php entry for $wgDBservers.' );
}
# Create object
$db = new $class( $host, $user, $password, $dbname, 1, $flags );
$db->setLBInfo( $server );
- wfProfileOut( __METHOD__ );
return $db;
}
}
}
}
+
+ /* Issue COMMIT only on master, only if queries were done on connection */
+ function commitMasterChanges() {
+ // Always 0, but who knows.. :)
+ $i = $this->getWriterIndex();
+ if (array_key_exists($i,$this->mConnections)) {
+ if ($this->mConnections[$i]->lastQuery() != '') {
+ $this->mConnections[$i]->immediateCommit();
+ }
+ }
+ }
function waitTimeout( $value = NULL ) {
return wfSetVar( $this->mWaitTimeout, $value );