Skip to content

Connection lost with pooling #626

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

Closed
changty opened this issue Oct 29, 2013 · 2 comments
Closed

Connection lost with pooling #626

changty opened this issue Oct 29, 2013 · 2 comments

Comments

@changty
Copy link

changty commented Oct 29, 2013

I'm currently using package [email protected] in my application. If the database connection is unused for enough time (determined in wait_timeout) there will be an error:

{ [Error: Connection lost: The server closed the connection.] fatal: true, code: 'PROTOCOL_CONNECTION_LOST' }

I'm using node-mysql's pooling feature, as shown in readme. I'm under the impression that pooling should take care of these time outs and connection losts, right? Is this a bug or am I just doing it wrong?

@rwky
Copy link
Contributor

rwky commented Oct 29, 2013

Nope pooling doesn't handle disconnects for you. You have to manage them yourself (along with all other errors), you'll want to check out this https://github.com/felixge/node-mysql#server-disconnects

@changty
Copy link
Author

changty commented Oct 29, 2013

Okay, then I got it wrong, thanks!

@changty changty closed this as completed Oct 29, 2013
dveeden pushed a commit to dveeden/mysql that referenced this issue Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants