Please sign in to comment.
Fixed #19861 -- Transaction ._dirty flag improvement
There were a couple of errors in ._dirty flag handling: * It started as None, but was never reset to None. * The _dirty flag was sometimes used to indicate if the connection was inside transaction management, but this was not done consistently. This also meant the flag had three separate values. * The None value had a special meaning, causing for example inability to commit() on new connection unless enter/leave tx management was done. * The _dirty was tracking "connection in transaction" state, but only in managed transactions. * Some tests never reset the transaction state of the used connection. * And some additional less important changes. This commit has some potential for regressions, but as the above list shows, the current situation isn't perfect either.
- Loading branch information...
Showing with 161 additions and 69 deletions.
- +18 −25 django/db/backends/__init__.py
- +1 −1 django/db/backends/creation.py
- +9 −0 django/db/backends/postgresql_psycopg2/base.py
- +2 −0 django/db/backends/postgresql_psycopg2/creation.py
- +3 −7 django/db/backends/util.py
- +0 −5 django/db/models/sql/compiler.py
- +0 −5 docs/ref/models/querysets.txt
- +3 −1 tests/delete_regress/tests.py
- +10 −3 tests/middleware/tests.py
- +7 −16 tests/select_for_update/tests.py
- +0 −2 tests/transactions/tests.py
- +108 −4 tests/transactions_regress/tests.py
Oops, something went wrong.