Skip to content
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

Auto reconnect to database if connection is lost for mysqli and pdo #545

Closed
wants to merge 1 commit into from

Conversation

dirtyren
Copy link

Hello,

I've added auto reconnect support for the mysqli and PDO drivers. I was having a lot of problems having mysql has gone away errors and this solves this problem.
I think it be simple to implement for every other database.

@Mike-Benoit
Copy link
Contributor

Sending a "SELECT 1" query to check if the connection is up for every other query that is executed is a non-starter unfortunately, as that would be horrible for performance.

Instead it needs to detect the disconnection by an error/exception and only retry at that point. PR #111 has something similar to that functionality if you want to take a look.

@dregad dregad added the wontfix label Nov 24, 2019
@dregad dregad closed this Nov 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants