lib/transactions.js
function () {
        // just to be sure! clear all items in the connections object. they should be cleared by now
        util.each(this.connections, function (value, prop, conns) {
            try {
                value.release();
            }
            catch (e) { } // nothing to do with error
            delete conns[prop];
        });

        // now execute end on the databases. will end pool if pool, or otherwise will execute whatever
        // `end` that has been exposed by db.js
        util.each(Transaction.databases, function (value, prop, databases) {
            value.end();
            databases[prop] = null;
        });
    }
function () {
        // just to be sure! clear all items in the connections object. they should be cleared by now
        util.each(this.connections, function (value, prop, conns) {
            try {
                value.release();
            }
            catch (e) { } // nothing to do with error
            delete conns[prop];
        });

        // now execute end on the databases. will end pool if pool, or otherwise will execute whatever
        // `end` that has been exposed by db.js
        util.each(Transaction.databases, function (value, prop, databases) {
            value.end();
            databases[prop] = null;
        });
    }
function ( ) { // just to be sure! clear all items in the connections object. they should be cleared by now util . each ( this . connections , function ( value , prop , conns ) { try { value . release ( ) ; } catch ( e ) { } // nothing to do with error delete conns [ prop ] ; } ) ; // now execute end on the databases. will end pool if pool, or otherwise will execute whatever // `end` that has been exposed by db.js util . each ( Transaction . databases , function ( value , prop , databases ) { value . end ( ) ; databases [ prop ] = null ; } ) ; }
This function needs to be called at the end of app-lifecycle to ensure all db connections are closed.
This function needs to be called at the end of app - lifecycle to ensure all db connections are closed .