-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Cannot call method 'ReleaseConnection' of null #589
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
Comments
What does the call to |
I'm getting the same thing. Definitely not setting the connection to null before calling release(). Actually release() is the first function called after query(). It doesn't occur every time, maybe once every few days. MySQL problem?
|
Can you show your code calling release where this happens, including where the |
I'm using connection pooling, and it looks like this. "pool" is global variable var pool;
pool = mysql.createPool({
user: 'xxx',
password: 'xxx',
database: 'track'
});
appsecure.post('/api/update', function(req, res) {
/* process request and generate db query */
pool.getConnection(function(err, connection) {
connection.query('INSERT INTO locations (track,latitude,longitude,horizontalaccuracy,timestamp) VALUES ' + dbvalues, function(err, results, fields) {
connection.release();
if (err) {
/* do something */
} else {
/* do something good */
}
});
});
}); |
It looks like the issue is that when a connection ends or encounters a fatal error, it is removed from the pool, but the |
* travis: submit coverage to coveralls * travis: fix install of coverage tools in matrix tests
I've had no problems with using pool so far but the other night I received this error, any ideas?
The text was updated successfully, but these errors were encountered: