protected function openConnection($create_tables = false)
  {
    //PHPCrawlerBenchmark::start("Connecting to SQLite-cache-db");
    
    // Open sqlite-file
    try
    {
      $this->PDO = new PDO("sqlite:".$this->sqlite_db_file);
    }
    catch (Exception $e)
    {
      throw new Exception("Error creating SQLite-cache-file, ".$e->getMessage().", try installing sqlite3-extension for PHP.");
    }
    
    $this->PDO->exec("PRAGMA journal_mode = OFF");
    
    $this->PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
    $this->PDO->setAttribute(PDO::ATTR_TIMEOUT, 100);
    
    if ($create_tables == true)
    {
      // Create url-table (if not exists)
      $this->PDO->exec("CREATE TABLE IF NOT EXISTS cookies (id integer PRIMARY KEY AUTOINCREMENT,
                                                            cookie_hash TEXT UNIQUE,
                                                            source_domain TEXT,
                                                            source_url TEXT,
                                                            name TEXT,
                                                            value TEXT,
                                                            domain TEXT,
                                                            path TEXT,
                                                            expires TEXT,
                                                            expire_timestamp INTEGER,
                                                            cookie_send_time INTEGER);");
      
      // Create indexes (seems that indexes make the whole thingy slower)
      $this->PDO->exec("CREATE INDEX IF NOT EXISTS cookie_hash ON cookies (cookie_hash);");
      
      $this->PDO->exec("ANALYZE;");
    }
    
    //PHPCrawlerBenchmark::stop("Connecting to SQLite-cache-db");
  }