Skip to content

Create Connection from existing PDO instance #5250

Closed as not planned
Closed as not planned
@oojacoboo

Description

@oojacoboo

BC Break Report

Prior to version 3, you could set the pdo property of the Doctrine\DBAL\Connection params. This allowed for you to reuse a PDO connection object.

Q A
BC Break yes
Version 3.3

Summary

The issue here is that you no longer have a way to reuse a connection with Doctrine. I guess the idea now is that you should initialize your PDO connection with Doctrine, then use the new getNativeConnection method.

Please reference this ticket as well: #4603.

Even if you overload the _conn property via reflection, you're still left with the error mentioned in this ticket.

SQLSTATE[HY000]: General error: user-supplied statement class must be derived from PDOStatement

The Doctrine\DBAL\Driver\PDO\Statement class doesn't extend PDOStatement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions