public function flush()
    {
        $this->getDatabase()->flushFile();

        // Flush the cache
        if ($cache = $this->getConfig()->getCache()) {
            $cache->flush();
        }
    }