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

database/sql: change default SQL connection lifetime to shorter value #34777

Closed
mcandre opened this issue Oct 8, 2019 · 2 comments
Closed

database/sql: change default SQL connection lifetime to shorter value #34777

mcandre opened this issue Oct 8, 2019 · 2 comments

Comments

@mcandre
Copy link

@mcandre mcandre commented Oct 8, 2019

The default SQL connection lifetime appears to be zero value, with the result that connections often break from (My)SQL server side default configurations of 8 hours.

Can Go change the default connection lifetime to a lesser value, such as 6 hours or 4 hours, in order to integrate better with typical SQL servers with regular batch, idle query patterns?

https://golang.org/src/database/sql/sql.go

@ianlancetaylor ianlancetaylor changed the title Better default SQL connection lifetime database/sql: better default SQL connection lifetime Oct 9, 2019
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 9, 2019

@andybons andybons changed the title database/sql: better default SQL connection lifetime database/sql: change default SQL connection lifetime to shorter value Oct 10, 2019
@andybons andybons added this to the Unplanned milestone Oct 10, 2019
@kardianos

This comment has been minimized.

Copy link
Contributor

@kardianos kardianos commented Jan 24, 2020

No.

Having any connection lifetime to me is... questionable at best. If you need a shorter lifetime, please set the DB pool options.

@kardianos kardianos closed this Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.