protected function lock()
    {
        $this->tables->execute();
        $table = array();

        while ($a = $this->tables->fetch(\PDO::FETCH_ASSOC)) {
            $table[] = current($a);
        }

        return !$table || $this->pdo->exec('LOCK TABLES `'.implode('` WRITE, `', $table).'` WRITE');
    }