Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Creating a duplicate database object for the same connection #3454

Closed
nazarhussain opened this issue Apr 26, 2019 · 1 comment
Closed

Creating a duplicate database object for the same connection #3454

nazarhussain opened this issue Apr 26, 2019 · 1 comment
Assignees

Comments

@nazarhussain
Copy link
Contributor

nazarhussain commented Apr 26, 2019

Expected behavior

Current implementation of pgp_adapter caused to a warning message

WARNING: Creating a duplicate database object for the same connection.
    at PgpAdapter.connect (lisk-sdk/framework/src/components/storage/adapters/pgp_adapter.js:107:18)
    at Storage.bootstrap (lisk-sdk/framework/src/components/storage/storage.js:43:23)
    at module.exports (lisk-sdk/framework/src/modules/http_api/init_steps/bootstrap_storage.js:19:32)
    at HttpApi.bootstrap (lisk-sdk/framework/src/modules/http_api/http_api.js:84:9)
    at process._tickCallback (internal/process/next_tick.js:68:7)

if you create multiple instance of storage component in the different modules.

Actual behavior

There should not be any warning or duplicate connections.

Steps to reproduce

Just start the application.

Which version(s) does this affect? (Environment, OS, etc...)

2.0.0

@nazarhussain
Copy link
Contributor Author

nazarhussain commented May 7, 2019

I can't find that warning any more in 2.0.0 branch. Tried to debug but not found any trace how it was resolved.

In case it pops up again, the following parameter can solve it.

https://github.com/vitaly-t/pg-promise/blob/147f119359c74839bad42b73c1d168fed3c869ab/lib/database.js#L61-L72

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants