]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - docs/database.txt
MediaWiki 1.15.0-scripts
[autoinstallsdev/mediawiki.git] / docs / database.txt
index 800447341fc45240d448dd472784b2dc958882a4..e80a4940785d0bf036bf96212fe6274b9764e8f4 100644 (file)
@@ -74,7 +74,7 @@ want to write code destined for Wikipedia.
 It's often the case that the best algorithm to use for a given task
 depends on whether or not replication is in use. Due to our unabashed
 Wikipedia-centrism, we often just use the replication-friendly version,
-but if you like, you can use $wgLoadBalancer->getServerCount() > 1 to
+but if you like, you can use wfGetLB()->getServerCount() > 1 to
 check to see if replication is in use.
 
 === Lag ===
@@ -110,7 +110,7 @@ in the session, and then at the start of each request, waiting for the
 slave to catch up to that position before doing any reads from it. If
 this wait times out, reads are allowed anyway, but the request is
 considered to be in "lagged slave mode". Lagged slave mode can be
-checked by calling $wgLoadBalancer->getLaggedSlaveMode(). The only
+checked by calling wfGetLB()->getLaggedSlaveMode(). The only
 practical consequence at present is a warning displayed in the page
 footer.
 
@@ -158,12 +158,9 @@ enclose small groups of queries in their own transaction. Use the
 following syntax:
 
 $dbw = wfGetDB( DB_MASTER );
-$dbw->immediateBegin();
+$dbw->begin();
 /* Do queries */
-$dbw->immediateCommit();
-
-There are functions called begin() and commit() but they don't do what
-you would expect. Don't use them.
+$dbw->commit();
 
 Use of locking reads (e.g. the FOR UPDATE clause) is not advised. They
 are poorly implemented in InnoDB and will cause regular deadlock errors.