Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.1.X] Fixed #12189 -- Corrected rollback behavior in database cache…

… backend. Thanks to Lakin Wecker for the report.

Backport of r12409 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12413 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a9282168f5952cfb5c7008c603aed78aaff142b2 1 parent 3792b2c
Russell Keith-Magee freakboy3742 authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/core/cache/backends/db.py
2  django/core/cache/backends/db.py
View
@@ -65,7 +65,7 @@ def _base_set(self, mode, key, value, timeout=None):
cursor.execute("INSERT INTO %s (cache_key, value, expires) VALUES (%%s, %%s, %%s)" % self._table, [key, encoded, str(exp)])
except DatabaseError:
# To be threadsafe, updates/inserts are allowed to fail silently
- transaction.rollback()
+ transaction.rollback_unless_managed()
return False
else:
transaction.commit_unless_managed()
Please sign in to comment.
Something went wrong with that request. Please try again.