protected function acquireLock($name, $timeout = 0)
{
if ($timeout !== 0) {
throw new InvalidParamException('PgsqlMutex does not support timeout.');
}
list($key1, $key2) = $this->getKeysFromName($name);
return (bool) $this->db->createCommand('SELECT pg_try_advisory_lock(:key1, :key2)', [':key1' => $key1, ':key2' => $key2])->queryScalar();
}