Commit a9282168 authored by Russell Keith-Magee's avatar Russell Keith-Magee
Browse files

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

[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
parent 3792b2cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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()