GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
I discovered a problem with CDbCacheDependency and reuseDependentData.
Check the following scenario:
Both foo() and bar() call getCache/setCache(), using different keys, but using the same dependency.
$dependency = new CDbCacheDependency("SELECT MAX(updatedOn) FROM Table");
$dependency->reuseDependentData = true; // execute dependency once per request
Solution: the dependency result still has to be compared to the cached dependency result. We simply remove the hasChanged boolean with the cached value and compare the data every time: http://pastebin.com/yD77KqK8
Is the example clear enough?
@marcovtwout, could you compose a Pull Request for this issue?
If you ready to do so, please read the contribution workflow first.
Resolved by commit 0adc8