Skip to content

Commit

Permalink
Fixed #12189 -- Corrected rollback behavior in database cache backend…
Browse files Browse the repository at this point in the history
…. Thanks to Lakin Wecker for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12409 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
freakboy3742 committed Feb 11, 2010
1 parent 75ab212 commit 4d2f489
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/core/cache/backends/db.py
Expand Up @@ -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)]) cursor.execute("INSERT INTO %s (cache_key, value, expires) VALUES (%%s, %%s, %%s)" % self._table, [key, encoded, str(exp)])
except DatabaseError: except DatabaseError:
# To be threadsafe, updates/inserts are allowed to fail silently # To be threadsafe, updates/inserts are allowed to fail silently
transaction.rollback() transaction.rollback_unless_managed()
return False return False
else: else:
transaction.commit_unless_managed() transaction.commit_unless_managed()
Expand Down

0 comments on commit 4d2f489

Please sign in to comment.