Skip to content

Databse connection timeout #112

Closed
Closed

Description

@willrnch

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

Activity

  1. dresende commented on Apr 10, 2013

    @dresende
    Owner

    You mean auto-reconnect right?

  2. dresende commented on Apr 10, 2013

    @dresende
    Owner

    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.

  3. dresende commented on Apr 10, 2013

    @dresende
    Owner

    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) {
        // ...
    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions