Actions
Bug #34129
closedCachingFramework: pdoBackend duplicate entry
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-02-21
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
The function "set" in the PdoBackend checks if the hash exists and only then removes it.
if ($this->has($entryIdentifier)) { $this->remove($entryIdentifier); }
But the function "has" selects unexpired entries only. If the cache entry is expired it won't be found by "has" and won't get removed before the new entry is created. PDO throws an expection in this case, because "set" tries to add an already existing entry:
SQLSTATE\[23000\]: Integrity constraint violation: 1062 Duplicate entry 'XXX' for key 'PRIMARY'
I suggest to fix this issue by always removing the entry when "set" is called, like the DbBackend does.
I don't know if sqllite would just overwrite the entry. I use the PdoBackend with MySQL.
Actions