Do not reset cache on commit and clear
When a transaction is committed indeed a new transaction is started. So we do not need to use a transaction cache just because a commit was sent because the started_at is reset to a higher time. This same logic applies to a rollback. issue10528 review365521003
This commit is contained in:
1 parent
f5f1328c12
commit
2de16cf0f4
1 file changed
+2
-5
+2
-5
@@ -250,7 +250,7 @@ class MemoryCache(BaseCache):
|
||||
@classmethod
|
||||
def commit(cls, transaction):
|
||||
table = Table(cls._table)
|
||||
reset = cls._reset.setdefault(transaction, set())
|
||||
reset = cls._reset.pop(transaction, None)
|
||||
if not reset:
|
||||
return
|
||||
database = transaction.database
|
||||
@@ -303,10 +303,7 @@ class MemoryCache(BaseCache):
|
||||
|
||||
@classmethod
|
||||
def rollback(cls, transaction):
|
||||
try:
|
||||
cls._reset[transaction].clear()
|
||||
except KeyError:
|
||||
pass
|
||||
cls._reset.pop(transaction, None)
|
||||
|
||||
@classmethod
|
||||
def drop(cls, dbname):
|
||||
|
||||
Reference in new issue
Block a user