Skip to content

[Cache] Missleading information when PDOAdapter Table is self created #12632

Closed
@regnerisch

Description

@regnerisch

At: https://symfony.com/doc/current/components/cache/adapters/pdo_doctrine_dbal_adapter.html the following sentence is wrong:

The table where values are stored is created automatically on the first call to the save() method.

It won't create the table if
A) doctrine/dbal is not installed
B) the doctrine dbal conntection is not used

This is because of (in doSave in PdoTrait)

            try {
                $stmt->execute();
            } catch (TableNotFoundException $e) {
                if (!$conn->isTransactionActive() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true)) {
                    $this->createTable();
                }
                $stmt->execute();
            }

the TableNotFoundException is thrown from doctrine/dbal but not from PDO it self. PDO only throws PDOExceptions. Possibly it is not a bug in the documentation but in the code itself.

@fabpot

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions