Ejemplo n.º 1
0
 public function doUpdate()
 {
     if (!$this->callback) {
         return;
     }
     $autoTrx = $this->dbw->getFlag(DBO_TRX);
     $this->dbw->clearFlag(DBO_TRX);
     try {
         /** @var Exception $e */
         $e = null;
         call_user_func_array($this->callback, [$this->dbw, $this->fname]);
     } catch (Exception $e) {
     }
     if ($autoTrx) {
         $this->dbw->setFlag(DBO_TRX);
     }
     if ($e) {
         throw $e;
     }
 }
Ejemplo n.º 2
0
 /**
  * @param IDatabase $conn
  */
 private function applyTransactionRoundFlags(IDatabase $conn)
 {
     if ($conn->getFlag($conn::DBO_DEFAULT)) {
         // DBO_TRX is controlled entirely by CLI mode presence with DBO_DEFAULT.
         // Force DBO_TRX even in CLI mode since a commit round is expected soon.
         $conn->setFlag($conn::DBO_TRX, $conn::REMEMBER_PRIOR);
         // If config has explicitly requested DBO_TRX be either on or off by not
         // setting DBO_DEFAULT, then respect that. Forcing no transactions is useful
         // for things like blob stores (ExternalStore) which want auto-commit mode.
     }
 }