Skip to content

Commit

Permalink
[3.0.x] Fixed #31423 -- Clarified nested atomic() example.
Browse files Browse the repository at this point in the history
Backport of fa5e7e4 from master
  • Loading branch information
charettes authored and felixxm committed Apr 6, 2020
1 parent 2c34979 commit 810f18c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/topics/db/transactions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ Django provides a single API to control database transactions.
In this example, even if ``generate_relationships()`` causes a database
error by breaking an integrity constraint, you can execute queries in
``add_children()``, and the changes from ``create_parent()`` are still
there. Note that any operations attempted in ``generate_relationships()``
will already have been rolled back safely when ``handle_exception()`` is
called, so the exception handler can also operate on the database if
necessary.
there and bound to the same transaction. Note that any operations attempted
in ``generate_relationships()`` will already have been rolled back safely
when ``handle_exception()`` is called, so the exception handler can also
operate on the database if necessary.

.. admonition:: Avoid catching exceptions inside ``atomic``!

Expand Down

0 comments on commit 810f18c

Please sign in to comment.