diff --git a/django/db/backends/base/features.py b/django/db/backends/base/features.py index f724d01894..2fcea1b864 100644 --- a/django/db/backends/base/features.py +++ b/django/db/backends/base/features.py @@ -26,7 +26,7 @@ class BaseDatabaseFeatures: can_return_id_from_insert = False can_return_ids_from_bulk_insert = False has_bulk_insert = True - uses_savepoints = False + uses_savepoints = True can_release_savepoints = False # If True, don't use integer foreign keys referring to, e.g., positive diff --git a/django/db/backends/dummy/features.py b/django/db/backends/dummy/features.py index 57a403aca7..ac91731969 100644 --- a/django/db/backends/dummy/features.py +++ b/django/db/backends/dummy/features.py @@ -3,3 +3,4 @@ from django.db.backends.base.features import BaseDatabaseFeatures class DummyDatabaseFeatures(BaseDatabaseFeatures): supports_transactions = False + uses_savepoints = False diff --git a/django/db/backends/mysql/features.py b/django/db/backends/mysql/features.py index ebfd591196..c978a942fb 100644 --- a/django/db/backends/mysql/features.py +++ b/django/db/backends/mysql/features.py @@ -23,7 +23,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): supports_timezones = False requires_explicit_null_ordering_when_grouping = True allows_auto_pk_0 = False - uses_savepoints = True can_release_savepoints = True atomic_transactions = False supports_column_check_constraints = False diff --git a/django/db/backends/oracle/features.py b/django/db/backends/oracle/features.py index c44b5041e7..89ebbff540 100644 --- a/django/db/backends/oracle/features.py +++ b/django/db/backends/oracle/features.py @@ -5,7 +5,6 @@ from django.utils.functional import cached_property class DatabaseFeatures(BaseDatabaseFeatures): interprets_empty_strings_as_nulls = True - uses_savepoints = True has_select_for_update = True has_select_for_update_nowait = True has_select_for_update_skip_locked = True diff --git a/django/db/backends/postgresql/features.py b/django/db/backends/postgresql/features.py index eddca77239..148e0766ed 100644 --- a/django/db/backends/postgresql/features.py +++ b/django/db/backends/postgresql/features.py @@ -14,7 +14,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): has_select_for_update = True has_select_for_update_nowait = True has_select_for_update_of = True - uses_savepoints = True can_release_savepoints = True supports_tablespaces = True supports_transactions = True diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py index 9918e44386..c56a393772 100644 --- a/django/db/backends/sqlite3/features.py +++ b/django/db/backends/sqlite3/features.py @@ -29,7 +29,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): ignores_table_name_case = True supports_cast_with_precision = False time_cast_precision = 3 - uses_savepoints = True can_release_savepoints = True @cached_property diff --git a/docs/releases/2.2.txt b/docs/releases/2.2.txt index 4a6e74fab3..8e03f54c3e 100644 --- a/docs/releases/2.2.txt +++ b/docs/releases/2.2.txt @@ -283,6 +283,8 @@ Database backend API ``DurationField`` or set ``DatabaseFeatures.can_introspect_duration_field`` to ``False``. +* ``DatabaseFeatures.uses_savepoints`` now defaults to ``True``. + :mod:`django.contrib.gis` -------------------------