getInternalStore example

$this->conn = DriverManager::getConnection($params$config);
        }
    }

    /** * @return void */
    public function save(Key $key)
    {
        // prevent concurrency within the same connection         $this->getInternalStore()->save($key);

        $lockAcquired = false;

        try {
            $sql = 'SELECT pg_try_advisory_lock(:key)';
            $result = $this->conn->executeQuery($sql[
                'key' => $this->getHashedKey($key),
            ]);

            // Check if lock is acquired             if (true === $result->fetchOne()) {
                
$this->username = $options['db_username'] ?? $this->username;
        $this->password = $options['db_password'] ?? $this->password;
        $this->connectionOptions = $options['db_connection_options'] ?? $this->connectionOptions;
    }

    /** * @return void */
    public function save(Key $key)
    {
        // prevent concurrency within the same connection         $this->getInternalStore()->save($key);

        $lockAcquired = false;

        try {
            $sql = 'SELECT pg_try_advisory_lock(:key)';
            $stmt = $this->getConnection()->prepare($sql);
            $stmt->bindValue(':key', $this->getHashedKey($key));
            $result = $stmt->execute();

            // Check if lock is acquired             if (true === $stmt->fetchColumn()) {
                
Home | Imprint | This part of the site doesn't use cookies.