/** * FROM MYSQL DOCS: * http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_release-lock * @param string $lockName * @param string $method * @return bool */ public function unlock($lockName, $method) { $lockName = $this->addQuotes($this->makeLockName($lockName)); $result = $this->query("SELECT RELEASE_LOCK({$lockName}) as lockstatus", $method); $row = $this->fetchObject($result); if ($row->lockstatus == 1) { parent::unlock($lockName, $method); // record return true; } wfDebug(__METHOD__ . " failed to release lock\n"); return false; }
/** * See http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKSFROM * PG DOCS: http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS * @param string $lockName * @param string $method * @return bool */ public function unlock($lockName, $method) { $key = $this->addQuotes($this->bigintFromLockName($lockName)); $result = $this->query("SELECT pg_advisory_unlock({$key}) as lockstatus", $method); $row = $this->fetchObject($result); if ($row->lockstatus === 't') { parent::unlock($lockName, $method); // record return true; } wfDebug(__METHOD__ . " failed to release lock\n"); return false; }
public function unlock($lockName, $method) { // http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS $key = $this->addQuotes($this->bigintFromLockName($lockName)); $result = $this->query("SELECT pg_advisory_unlock({$key}) as lockstatus", $method); $row = $this->fetchObject($result); if ($row->lockstatus === 't') { parent::unlock($lockName, $method); // record return true; } $this->queryLogger->debug(__METHOD__ . " failed to release lock\n"); return false; }