Databse connection timeout #112

Closed
williamriancho opened this Issue Apr 10, 2013 · 3 comments

Comments

Projects
None yet
2 participants

Keeping connection open cause problems with services (like cleardb) that kill the connection after a few times.

Owner

dresende commented Apr 10, 2013

You mean auto-reconnect right?

Owner

dresende commented Apr 10, 2013

I'm working on something but for now it's just for mysql, I still have to see how the other drivers can handle it.

dresende added a commit that referenced this issue Apr 10, 2013

Owner

dresende commented Apr 10, 2013

Usage:

orm.settings.set("connection.reconnect", true);
orm.connect("...", function (err, db) {
    // ...
});

This option automatically reconnects (only mysql for now) when connection drops. I'm not sure this is what you're looking for. Perhaps you're better with the pool option, which only connects (if needed) when a query is required:

orm.connect("mysql://..../database?pool=true", function (err, db) {
    // ...
});

@dresende dresende closed this Apr 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment