Commit ee837b9a authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

Increased robustness of 58161e4e. Refs #22291.

parent 81761508
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -217,7 +217,13 @@ class Atomic(object):
                        try:
                            connection.savepoint_commit(sid)
                        except DatabaseError:
                            try:
                                connection.savepoint_rollback(sid)
                            except Error:
                                # If rolling back to a savepoint fails, mark for
                                # rollback at a higher level and avoid shadowing
                                # the original exception.
                                connection.needs_rollback = True
                            raise
                else:
                    # Commit transaction
@@ -243,7 +249,7 @@ class Atomic(object):
                    else:
                        try:
                            connection.savepoint_rollback(sid)
                        except DatabaseError:
                        except Error:
                            # If rolling back to a savepoint fails, mark for
                            # rollback at a higher level and avoid shadowing
                            # the original exception.