1
0
mirror of https://github.com/django/django.git synced 2024-12-24 18:16:19 +00:00

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
This commit is contained in:
Russell Keith-Magee 2010-02-11 12:10:11 +00:00
parent 75ab212d12
commit 4d2f489bca

View File

@ -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()