Issue on saving entites to database
See original GitHub issue[Details] If i try to save hundreds of entities in a loop to the database (initiated by a HTTP-Request to a controller) the code execution stops after 99 loop iterations. The log-output at the end of the controller-method is never reached. On the database there are only 99 (of more then 200) entities saved. If i try the same without await on the repository-save method the loop runs all iterations but in database are still only 99 entities. Tested every time with an empty table in the database and on different systems.
[Stacktrace] No exception or error
[Scenario] To reproduce the behavior i have created a minimalistic example: https://github.com/andreas-barthel/mandarine-test
- clone example repository
- edit databases settings in properties.json (maybe the listen-port etc.)
- run the application
- call controller-method:
/hello-world
to try to save hundreds of entities without await on repository-save-method - check database
- delete all entities
- restart application
- call controller-method
/hello-word-await
with await on repository-save-method
[Expected behavior] Hundredes of entities in database-table
[Additional Information] If i try to call the HTTP-Endpoints multiple times without restart of the application or delete the table rows, then the behavior changes. More or less iterations, less entities in database and so on.
Here is an example output-log of the application: console logging.txt
[OS & Environment]
Windows 10 Pro 1909
Mandarine 2.0.0 Deno version 1.3.2 Deno v8 version 8.6.334 typescript version 4.0.2
Ubuntu Linux
Mandarine 2.0.0 Deno version 1.3.2 Deno v8 version 8.6.334 typescript version 4.0.2
Database
PostgreSQL version 10.14 (with max-connections set to 500)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
@andreas-barthel No Problem. Let my know if you need some informations or some tests on my environments.
@andreas-barthel We have released this fix #176 in 2.0.1, it’s already published in deno.land/x . Hopefully it will be solved for you as well (you need to strictly use
await
). Let us know if the issue persists.