public function replace($identifier, $value)
    {
        // store current data to be able to restore on error;
        $oldValue = @$this->registry[$this->section][$identifier];

        parent::replace($identifier, $value);

        $sql = sprintf(
            'UPDATE %s SET `data`=`%s` WHERE `entityId`=`%s`;',
            $this->mysql->quote($this->section),
            $this->mysql->quote($value),
            $this->mysql->quote($identifier)
        );

        $result = $this->mysql->exec($sql);

        if (false === $result) {

            $this->registry[$this->section][$identifier] = $oldValue;

            $this->throwException(
                'Failed to fetch information from the registry: ',
                $this->mysql->errorInfo()
            );
        }
    }