Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ensure consistency between the cache state and cached data in DefaultReflectorFactory. #3492

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

Open
izayoiyurin wants to merge 1 commit into mybatis:master
base: master
Choose a base branch
Loading
from izayoiyurin:master

Conversation

@izayoiyurin
Copy link

@izayoiyurin izayoiyurin commented Jun 23, 2025

  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.

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

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /