Removed useless field in SqlBagOStuff
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 9 Nov 2015 06:02:30 +0000 (22:02 -0800)
committerBryanDavis <bdavis@wikimedia.org>
Tue, 10 Nov 2015 01:05:03 +0000 (01:05 +0000)
Change-Id: I27c0b35769667ce48ba761ff4bbc828033c6849d

includes/objectcache/SqlBagOStuff.php

index a6f2d37..5776519 100644 (file)
@@ -27,8 +27,6 @@
  * @ingroup Cache
  */
 class SqlBagOStuff extends BagOStuff {
-       /** @var LoadBalancer */
-       protected $lb;
        /** @var array */
        protected $serverInfos;
        /** @var array */
@@ -150,15 +148,13 @@ class SqlBagOStuff extends BagOStuff {
                                $db = DatabaseBase::factory( $type, $info );
                                $db->clearFlag( DBO_TRX );
                        } else {
-                               /*
-                                * We must keep a separate connection to MySQL in order to avoid deadlocks
-                                * However, SQLite has an opposite behavior. And PostgreSQL needs to know
-                                * if we are in transaction or no
-                                */
+                               // We must keep a separate connection to MySQL in order to avoid deadlocks
+                               // However, SQLite has an opposite behavior. And PostgreSQL needs to know
+                               // if we are in transaction or not (@TODO: find some work-around).
                                $index = $this->slaveOnly ? DB_SLAVE : DB_MASTER;
                                if ( wfGetDB( $index )->getType() == 'mysql' ) {
-                                       $this->lb = wfGetLBFactory()->newMainLB();
-                                       $db = $this->lb->getConnection( $index );
+                                       $lb = wfGetLBFactory()->newMainLB();
+                                       $db = $lb->getConnection( $index );
                                        $db->clearFlag( DBO_TRX ); // auto-commit mode
                                } else {
                                        $db = wfGetDB( $index );