1
0
mirror of https://github.com/django/django.git synced 2025-10-29 16:46:11 +00:00

Removed legacy transaction management per the deprecation timeline.

This commit is contained in:
Aymeric Augustin
2014-03-21 14:21:43 +01:00
parent 907ac64641
commit 0f9560855e
29 changed files with 78 additions and 1454 deletions

View File

@@ -391,7 +391,7 @@ class QuerySet(object):
self._for_write = True
connection = connections[self.db]
fields = self.model._meta.local_concrete_fields
with transaction.commit_on_success_unless_managed(using=self.db):
with transaction.atomic(using=self.db, savepoint=False):
if (connection.features.can_combine_inserts_with_and_without_auto_increment_pk
and self.model._meta.has_auto_field):
self._batched_insert(objs, fields, batch_size)
@@ -437,7 +437,7 @@ class QuerySet(object):
for k, v in six.iteritems(defaults):
setattr(obj, k, v)
with transaction.atomic(using=self.db):
with transaction.atomic(using=self.db, savepoint=False):
obj.save(using=self.db)
return obj, False
@@ -574,7 +574,7 @@ class QuerySet(object):
self._for_write = True
query = self.query.clone(sql.UpdateQuery)
query.add_update_values(kwargs)
with transaction.commit_on_success_unless_managed(using=self.db):
with transaction.atomic(using=self.db, savepoint=False):
rows = query.get_compiler(self.db).execute_sql(CURSOR)
self._result_cache = None
return rows