Connecting to the database synchronously
See original GitHub issueIs it possible to connect to the database synchronously? For my app, there’s no issue with the current asynchronous method, but I’m running into weird timing issues. I wouldn’t want my app to run at all if the database is not ready, because it wouldn’t make sense. Also, I would like to create a connection once and reuse it in separate places, but this doesn’t seem to be officially supported.
The error message I get with the tests RepositoryNotFoundError: No repository for "Material" was found. Looks like this entity is not registered in current "default" connection?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Why is Go connecting to a database synchronously?
I do find it weird that code is mostly synchronous - even things like connecting and communicating with the database, e.g.
Read more >Using synchronous and asynchronous database operations
A single database connection can't execute some operations or statements synchronously and others asynchronously. You specify whether a SQLConnection ...
Read more >Data synchronization in SQL Server Always On Availability ...
This article describes the data synchronization process on SQL Server Always On Availability Groups in both Synchronous, and Asynchronous ...
Read more >Synchronous and asynchronous query execution
Queries can be executed against the database synchronously or asynchronously. The correct execution paradigm to use depends on the application.
Read more >How to setup a synchronously Mirrored Database
Setup in Synchronous Mode · 1. On the machine that is to be used as Principal, connect via Microsoft SQL Server Management Studio...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
no, it does not make sense
you simply need to figure out your problems and get know how to properly handle all async processes in node apps
you can create a
QueryRunner
which holds a single database connection and use it across the app. Useconnection.createQueryRunner()
for this purpose. And remember to release it once you done with it (using queryRunner.release method)did you register your entity in “entity” section of connection config?
@NoNameProvided looks like it’s related. Thanks