Skip to content

Conversation

dennisweil
Copy link
Contributor

@dennisweil dennisweil commented Jul 30, 2025

Make the session commits and rollbacks threadsafe via a lock that makes these database operations synchronous.

Resolves F-318

  • I have added automatic tests where applicable.
  • The PR contains a description of what has been changed.
  • The description contains manual test instructions.
  • The PR contains updates to the release notes.
  • I have verified that the documentation is still up to date.

Changes

  • fix minor problem with regex patterns not being raw strings (this lead to unknown escape sequence errors in newer python versions)
  • guard the commit, rollback and merge Session functionality with _thread_lock context manager

Test

  • run automated tests

@dennisweil dennisweil force-pushed the f-318_threadsafe-session-sharing branch from c2715b8 to b87dd22 Compare July 30, 2025 14:26
The implementation as a decorator had problems
with different sessions getting out of sync and not committing
the same data, effectively nulling any database changes.
@dennisweil dennisweil marked this pull request as ready for review July 31, 2025 14:30
@dennisweil dennisweil requested a review from a team as a code owner July 31, 2025 14:30
@dennisweil dennisweil requested a review from torsdag July 31, 2025 14:30
@dennisweil dennisweil merged commit 95ac2ae into main Aug 4, 2025
12 checks passed
@dennisweil dennisweil deleted the f-318_threadsafe-session-sharing branch August 4, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants