Comments (5)
Did you read #22
from mymysql.
database/sql manages connection itself (establishes new if it need, reconnect if connection was closed). Pinging idle connection need concurrent access to the connection, so it need to introduce mutexes and other overhead like in mymysql/thrsafe engine (mymysql/thrsafe implements keepalive on idle connection using SQL PING command).
Because of database/sql behavior to manage pool of connections and automatically reconnect if some connection was closed, godrv by default uses mymysql/native engine. If you want keepalives import thrsafe engine with godrv like this:
import (
_ github.com/ziutek/mymysql/thrsafe
_ github.com/ziutek/mymysql/godrv
database/sql
)
from mymysql.
So even if use the godrv package without the thrsafe, database/sql would handle the "mysql has gone away" problem for me?
from mymysql.
Did you read database/sql documentation or use it before create this issue?
from mymysql.
Please make sure to run Go 1.0.3 or higher. In older versions there was a bug which caused database/sql to not handle closed connections well.
See http://code.google.com/p/go/source/detail?r=b397807815a6 for more details
from mymysql.
Related Issues (20)
- SSL support HOT 1
- Timezone support HOT 5
- Not connecting when given a tcp: string HOT 2
- how to set charset utf8 HOT 4
- bug in Driver.Register
- driver: bad connection error HOT 2
- timeout on long running Queries HOT 1
- panic when running concurrent queries HOT 2
- Reply is not completely read error after running the query SELECT 1 HOT 4
- has issue with multi result HOT 1
- go1.8: support for additional features
- godrv/driver.go: ineffective assignment HOT 2
- Go vet warning HOT 1
- Add Context support
- Unable to connect to MySQL 8 HOT 4
- cannot insert emoji text HOT 3
- SQL error HOT 2
- db.Connect() sometime an error occurred 'unexpected EOF'
- Threadsafe + Autoreconnect is not thread safe
- Please add support for JSON column
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mymysql.