summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-02-20 03:11:54 +0200
committerAnssi Kääriäinen <akaariai@gmail.com>2013-02-27 17:54:27 +0200
commit50328f0a618674b7143d86acaa7016c5293e9774 (patch)
treee178109ebf08a5f3d37aa0c79a6d4b88db4cc898 /django/db/models/sql
parent210894167799780283101636c99d8010b30bf09c (diff)
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.
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/compiler.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 22d025ecb2..b9d25d98a1 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -687,11 +687,6 @@ class SQLCompiler(object):
resolve_columns = hasattr(self, 'resolve_columns')
fields = None
has_aggregate_select = bool(self.query.aggregate_select)
- # Set transaction dirty if we're using SELECT FOR UPDATE to ensure
- # a subsequent commit/rollback is executed, so any database locks
- # are released.
- if self.query.select_for_update and transaction.is_managed(self.using):
- transaction.set_dirty(self.using)
for rows in self.execute_sql(MULTI):
for row in rows:
if resolve_columns: