summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-02-11 12:10:11 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-02-11 12:10:11 +0000
commit4d2f489bca6b1807724f4b619d70ae8d6d1bda08 (patch)
tree04da619d78a944c3ab0217a718a26d6b8617630b
parent75ab212d12058494eaf171acfc762206d8a62d47 (diff)
Fixed #12189 -- Corrected rollback behavior in database cache backend. Thanks to Lakin Wecker for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12409 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/cache/backends/db.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/cache/backends/db.py b/django/core/cache/backends/db.py
index 13dc5c1b0c..dd18cd6b1d 100644
--- a/django/core/cache/backends/db.py
+++ b/django/core/cache/backends/db.py
@@ -65,7 +65,7 @@ class CacheClass(BaseCache):
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()