WARNING: Creating a duplicate database object for the same connection

This warning is popping up few times even with empty lisk-sdk dapp. Each module using db connection adds another warning. I’m not experienced with neither node.js nor postgresql. Why is it happening, is it important to keep number of these warning to the minimum?

Having multiple asynchronous connections to database is not an oddity.

    WARNING: Creating a duplicate database object for the same connection.
        at PgpAdapter.connect (/home/ldice/ldicedev/node_modules/lisk-framework/src/components/storage/adapters/pgp_adapter.js:89:13)
        at Storage.bootstrap (/home/ldice/ldicedev/node_modules/lisk-framework/src/components/storage/storage.js:40:23)
        at module.exports (/home/ldice/ldicedev/node_modules/lisk-framework/src/modules/chain/init_steps/bootstrap_storage.js:42:32)
        at Chain.bootstrap (/home/ldice/ldicedev/node_modules/lisk-framework/src/modules/chain/chain.js:133:10)
1 Like

This warning is output from the underline library pg-promise, one process using multiple instance to connect to the same database.

Related to: https://github.com/vitaly-t/pg-promise/wiki/FAQ#warning-creating-a-duplicate-database-object-for-the-same-connection

1 Like

As per the Database API, you should not create more than one Database object for the same connection, as it will only slow down your application and consume more memory.

Does it cause any problems or performance drop in case of lisk-sdk?