summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-03-03 15:55:11 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-03-11 14:48:54 +0100
commit5e27debc5cba30c84f99151a84c5fd846a65b091 (patch)
treebb8e8c214d104f9035446195887d04a93afb011c /django
parentcfc114e00ebe2ac16c37af2ccee1ed8e47247b7a (diff)
Enabled database-level autocommit for all backends.
This is mostly a documentation change. It has the same backwards-incompatibility consequences as those described for PostgreSQL in a previous commit.
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/__init__.py2
-rw-r--r--django/db/backends/postgresql_psycopg2/base.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index 26a84e6e60..4031e8f668 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -98,6 +98,8 @@ class BaseDatabaseWrapper(object):
conn_params = self.get_connection_params()
self.connection = self.get_new_connection(conn_params)
self.init_connection_state()
+ if not settings.TRANSACTIONS_MANAGED:
+ self.set_autocommit()
connection_created.send(sender=self.__class__, connection=self)
def ensure_connection(self):
diff --git a/django/db/backends/postgresql_psycopg2/base.py b/django/db/backends/postgresql_psycopg2/base.py
index 6ea2dd3099..5c5f5e185a 100644
--- a/django/db/backends/postgresql_psycopg2/base.py
+++ b/django/db/backends/postgresql_psycopg2/base.py
@@ -136,7 +136,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
self.connection.cursor().execute(
self.ops.set_time_zone_sql(), [tz])
self.connection.set_isolation_level(self.isolation_level)
- self.set_autocommit(not settings.TRANSACTIONS_MANAGED)
def create_cursor(self):
cursor = self.connection.cursor()