protected function prepare($sql) {
        $this->checkConnection();

        $sqlKey = md5($sql);
        if ($this->_statementCache->exists($sqlKey))
            return $this->_statementCache->get($sqlKey);

        try {
            // No need to check the connection again
            $statement = $this->getConnection(false)->prepare($sql);
        } catch (\PDOException $pe) {
            throw new \Exception("Error in preparing statement:: query: ".$sql.PHP_EOL."Message: ".$pe->getMessage());
        }

        $this->_statementCache->set($sqlKey, $statement);
        return $statement;
    }