Skip to content

Commit

Permalink
uow: possible solution for the rollback problem
Browse files Browse the repository at this point in the history
* the rollback should only rollback whats in that savepoint. using
  session.begin_nested creates a subtransaction which can then
  rolledback
  • Loading branch information
utnapischtim committed Nov 15, 2024
1 parent cc7b450 commit f00e461
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions invenio_db/uow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2024 CERN.
# Copyright (C) 2024 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -167,6 +168,7 @@ def __init__(self, session=None):

def __enter__(self):
"""Entering the context."""
self.session.begin_nested()
return self

def __exit__(self, exc_type, exc_value, traceback):
Expand Down

0 comments on commit f00e461

Please sign in to comment.