Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #3024 -- Fixed database commit() and rollback() behaviour so it…

… works

consistently if you execute them before Django has made a database connection.
Thanks Bastian Kleineidam.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@4691 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit cc8d656569cd907a92b8b292e3a6627d5f9a5290 1 parent 8248569
@malcolmt malcolmt authored
View
1  AUTHORS
@@ -112,6 +112,7 @@ answer newbie questions, and generally made Django that much better:
Garth Kidd <http://www.deadlybloodyserious.com/>
kilian <kilian.cavalotti@lip6.fr>
Sune Kirkeby <http://ibofobi.dk/>
+ Bastian Kleineidam <calvin@debian.org>
Cameron Knight (ckknight)
Meir Kriheli <http://mksoft.co.il/>
Bruce Kroeze <http://coderseye.com/>
View
5 django/db/backends/ado_mssql/base.py
@@ -76,10 +76,11 @@ def cursor(self):
return cursor
def _commit(self):
- return self.connection.commit()
+ if self.connection is not None:
+ return self.connection.commit()
def _rollback(self):
- if self.connection:
+ if self.connection is not None:
return self.connection.rollback()
def close(self):
View
5 django/db/backends/mysql/base.py
@@ -108,10 +108,11 @@ def cursor(self):
return cursor
def _commit(self):
- self.connection.commit()
+ if self.connection is not None:
+ self.connection.commit()
def _rollback(self):
- if self.connection:
+ if self.connection is not None:
try:
self.connection.rollback()
except Database.NotSupportedError:
View
5 django/db/backends/oracle/base.py
@@ -43,10 +43,11 @@ def cursor(self):
return FormatStylePlaceholderCursor(self.connection)
def _commit(self):
- self.connection.commit()
+ if self.connection is not None:
+ self.connection.commit()
def _rollback(self):
- if self.connection:
+ if self.connection is not None:
try:
self.connection.rollback()
except Database.NotSupportedError:
View
5 django/db/backends/postgresql/base.py
@@ -92,10 +92,11 @@ def cursor(self):
return cursor
def _commit(self):
- return self.connection.commit()
+ if self.connection is not None:
+ return self.connection.commit()
def _rollback(self):
- if self.connection:
+ if self.connection is not None:
return self.connection.rollback()
def close(self):
View
5 django/db/backends/postgresql_psycopg2/base.py
@@ -60,10 +60,11 @@ def cursor(self):
return cursor
def _commit(self):
- return self.connection.commit()
+ if self.connection is not None:
+ return self.connection.commit()
def _rollback(self):
- if self.connection:
+ if self.connection is not None:
return self.connection.rollback()
def close(self):
View
5 django/db/backends/sqlite3/base.py
@@ -67,10 +67,11 @@ def cursor(self):
return cursor
def _commit(self):
- self.connection.commit()
+ if self.connection is not None:
+ self.connection.commit()
def _rollback(self):
- if self.connection:
+ if self.connection is not None:
self.connection.rollback()
def close(self):
Please sign in to comment.
Something went wrong with that request. Please try again.