Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#1222 Clear static DAO cache when writing to DAO #15171

Merged
merged 1 commit into from
Sep 6, 2019

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Aug 30, 2019

Overview

This addresses the problem raised in https://lab.civicrm.org/dev/core/issues/1222

Before

Stale data in cache would persist even after dao items were updated.

After

Static cache cleared whenever updating or deleting a dao object.

@civibot civibot bot added the master label Aug 30, 2019
@civibot
Copy link

civibot bot commented Aug 30, 2019

(Standard links)

@colemanw colemanw force-pushed the daoCache branch 2 times, most recently from dc72790 to 06c9e9b Compare August 31, 2019 19:11
@eileenmcnaughton
Copy link
Contributor

@colemanw this makes sense but I'm not sure about the removals of ->free()

We have done this in most places in the code but we left it in those few places in the DAO where db actions are taken (rather than it being an attempt to clean up memory).

Merging this would remove from delete & setFieldValue but not save. In the case of setFieldValue it still gets called in ->save() but I think we should keep the ->free() call in delete in this PR & consider it separately since I think it needs more thought about whether we might be leaving something cached that we shouldn't

@colemanw
Copy link
Member Author

colemanw commented Sep 6, 2019

@eileenmcnaughton ok I've dialed back removals of free() to just the one in getFieldValue

@eileenmcnaughton
Copy link
Contributor

Thanks I think this is good now

@eileenmcnaughton eileenmcnaughton merged commit d626b67 into civicrm:master Sep 6, 2019
@eileenmcnaughton eileenmcnaughton deleted the daoCache branch September 6, 2019 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants