public function prepare($sql, $options = null)
    {

        $md5 = md5($sql);

        if (isset($this->prepared_sql[$md5])) {
            return $this->prepared_sql[$md5];
        }

        //$this->writeToLog("Preparing: ".$sql);
        $stmt = parent::prepare($sql);
        $this->prepared_sql[$md5] = $stmt;
        return $stmt;
    }