Skip to content

Conversation

izayoiyurin
Copy link

  1. When disabling the cache, an attempt is made to clear all cached Reflector instances. However, complete clearance cannot be strictly guaranteed due to potential concurrent writes.

  2. To ensure that stale data does not affect new cache entries, the cache is proactively cleared again when re-enabling caching.

This change guarantees that once caching is turned back on, it always starts with a clean state, preventing any residual data from the previous caching cycle from being reused.

@harawata
Copy link
Member

harawata commented Jul 6, 2025

Hello @izayoiyurin ,

I don't understand why this is necessary.
Usually, class definitions do not change, so there is no point in clearing the cache.
And if, for whatever reason, you want to clear the stale cache, you can just create/set a new instance of DefaultReflectorFactory to the Configuration.

Please let me know if I am missing something.

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