Skip to content

fix: use engine.begin() instead of connect()

Pavel Břoušek requested to merge brousek/use_engine_begin into main

Description

fix: use engine.begin() instead of connect()

begin() automatically commits transaction, so that modifications are not lost

connect() without explicit commit rolls back all inserts

How to test

observe whether there are new rows in the database when insert operations should be happening

Author's checklist

  • I have followed the contribution guidelines
  • This MR has been tested or does not change functionality
  • I have added relevant merge request dependencies (if this MR has any)
  • I have added the correct labels
  • I have assigned reviewers (if any are relevant)
  • I have edited the documentation (if the changes require it) or I have noted the need for the change if I do not have access to the documentation
  • I have marked all introduced BREAKING CHANGES or necessary DEPLOYMENT NOTES in the commit message(s)

Reviewer's checklist

  • This MR has been tested or does not change functionality
  • This MR has correct commit message format

Other information

Previously there were a couple of bugs caused by inserts inside uncommited transactions. This makes the code safer for the future.

Related issues

N/A

Merge request reports