Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Messenger] Leverage DBAL's getNativeConnection() method #44309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

derrabus
Copy link
Member

Q A
Branch? 5.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

Doctrine DBAL 3 introduced a new driver middleware system that makes it difficult to unwrap the native PDO connection which we need for Messenger's Postgres transport. If an application would actually make use of the middleware system, accessing the PDO connection would become impossible for us.

Because of that, I have added a method getNativeConnection() to DBAL with doctrine/dbal#5037. This PR leverages this new method.

@carsonbot carsonbot changed the title Leverage DBAL's getNativeConnection() method [Messenger] Leverage DBAL's getNativeConnection() method Nov 27, 2021
@carsonbot carsonbot added this to the 5.3 milestone Nov 27, 2021
@carsonbot
Copy link

Hey!

I think @tgalopin has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@nicolas-grekas
Copy link
Member

getWrappedConnection is also called in Cache and HttpFoundation (in 4.4 for both also)
Should these be updated too?

@derrabus
Copy link
Member Author

In cache, we use getWrappedConnection() to get the driver's connection, not the native one. This will still work reliably and unless we want to make the 4.4 branch compatible with DBAL 4, we don't need to change that.

In HttpFoundation, we let DBAL bootstrap a PDO Oracle connection.This code almost certainly breaks if you run it with DBAL 3. I have no Oracle test environment, I'm afraid. Otherwise, I would gladly fix it. 🙁

@fabpot
Copy link
Member

fabpot commented Nov 29, 2021

Thank you @derrabus.

@fabpot fabpot merged commit af596bf into symfony:5.3 Nov 29, 2021
This was referenced Nov 29, 2021
@derrabus derrabus deleted the improvement/get-native-connection branch December 3, 2021 22:50
@fabpot fabpot mentioned this pull request Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants