Refer to #1967266: Stop flushing entire entity load cache bins unnecessarily for more details.
Wherever possible, only flush the necessary entities from the cache, using entity_get_controller($entity_type)->resetCache(array($entity_id));
In this module quiz_insert()
sometimes does this:
$old_quiz = node_load($node->clone_from_original_nid, NULL, TRUE);
I haven't examined what's going on here in detail, but assuming it is necessary for the load cache to be bypassed for this particular load, then use entity_load_unchanged($entity_type, $id)
to load it (which runs the resetCache() and load() sequence for that single ID).
(Or if the reset was actually to flush something else, then just flush that thing explicitly.)
Comment | File | Size | Author |
---|---|---|---|
#3 | don_t_use_reset_flag-2750513-3.patch | 514 bytes | djdevin |
Comments
Comment #2
jweowu CreditAttribution: jweowu commentedComment #3
djdevinI'm not sure why that is there (probably very old) so I'll just remove it if the tests pass.
Comment #5
djdevinComment #7
djdevinComment #8
jweowu CreditAttribution: jweowu commentedThanks for following up, djdevin.
Please don't mark someone as the author of a commit which they didn't author, though. I do appreciate the good intent behind it, but I've seen cases of people actually introducing bugs in someone else's name, so you should only ever set the author of a commit if that person actually wrote the patch.