Changes between Version 2 and Version 3 of Ticket #36785, comment 5


Ignore:
Timestamp:
Dec 8, 2025, 11:04:04 PM (3 weeks ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36785, comment 5

    v2 v3  
    55Now that no explicit `transaction.atomic` usage is made the database error your RLS policy triggers is not allowed to reach `transaction.Atomic.__exit__` in your test which goes against its documented usage (see [https://docs.djangoproject.com/en/6.0/topics/db/transactions/#django.db.transaction.atomic Avoid catching exceptions inside atomic!]) and leaves the connection in a unusable state.
    66
    7 TL;DR your usage of `transaction.atomic` is incorrect but it was masked by `bulk_create` creating a nested `atomic` previously (which was implementation detail) and you should do the following instead
     7TL;DR your usage of `transaction.atomic` was always incorrect but it used to be masked by `bulk_create` implicit creation of a nested `atomic` (which is an implementation detail) and you should have been doing the following instead
    88
    99{{{#!python
Back to Top