question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

  1. clone example repository
  2. edit databases settings in properties.json (maybe the listen-port etc.)
  3. run the application
  4. call controller-method: /hello-world to try to save hundreds of entities without await on repository-save-method
  5. check database
  6. delete all entities
  7. restart application
  8. 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:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
andreas-barthelcommented, Sep 1, 2020

@andreas-barthel No Problem. Let my know if you need some informations or some tests on my environments.

0reactions
andreespirelacommented, Sep 2, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to save entity into database? - java - Stack Overflow
After you open the session and save the object... flush the session, then close it. Session session = sessionFactory.
Read more >
Spring Data JPA Tutorial - #14 - save() Method - YouTube
Hi, welcome to the Spring Data JPA tutorial series/course.In this lecture, we will learn how to save an entity to the database using...
Read more >
How To Save Data Into Database Using Spring Data JPA
In this article we will go through “How to Save Data into Database Using Spring Data JPA : Step by Step Tutorial”. If...
Read more >
Spring Data - CrudRepository save() Method - Baeldung
Learn how to save and update entities to a database using Spring Data CrudRepository.
Read more >
Saving Data - 4.x - CakePHP Cookbook
If you are using newEntity() and the resulting entities are missing some or all of the data they were passed, double check that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found