mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Deprecated transaction.commit/rollback_unless_managed.
Since "unless managed" now means "if database-level autocommit", committing or rolling back doesn't have any effect. Restored transactional integrity in a few places that relied on automatically-started transactions with a transitory API.
This commit is contained in:
parent
14aa563f51
commit
ba5138b1c0
17 changed files with 116 additions and 208 deletions
|
@ -460,8 +460,6 @@ class QuerySet(object):
|
|||
self._batched_insert(objs_without_pk, fields, batch_size)
|
||||
if forced_managed:
|
||||
transaction.commit(using=self.db)
|
||||
else:
|
||||
transaction.commit_unless_managed(using=self.db)
|
||||
finally:
|
||||
if forced_managed:
|
||||
transaction.leave_transaction_management(using=self.db)
|
||||
|
@ -590,8 +588,6 @@ class QuerySet(object):
|
|||
rows = query.get_compiler(self.db).execute_sql(None)
|
||||
if forced_managed:
|
||||
transaction.commit(using=self.db)
|
||||
else:
|
||||
transaction.commit_unless_managed(using=self.db)
|
||||
finally:
|
||||
if forced_managed:
|
||||
transaction.leave_transaction_management(using=self.db)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue