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

Support caching queries with autodiscovered types #3184

Merged
merged 24 commits into from
Oct 27, 2022

Conversation

fredericDelaporte
Copy link
Member

re-fix #3169

@hazzik
Copy link
Member

hazzik commented Oct 16, 2022

I think adding the aliases in the middle can break already cached objects because internal format of the cache will change. Can we add indexes to the end? Or what do you think?

Co-authored-by: Roman Artiukhin <bahusdrive@gmail.com>
Comment on lines -274 to +310
if (finalReturnTypes[i] == null)
if (cacheables[i] == null)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking for null return types as a marker of cache miss is wrong for empty result lists with type auto-discovery: their return types are null, but that is no cache miss. So instead, we need to nullify the cacheable when it is a cache miss due to its timestamp.

@fredericDelaporte fredericDelaporte added this to the 5.4 milestone Oct 23, 2022
Co-authored-by: Alex Zaytsev <hazzik@gmail.com>
bahusoid
bahusoid previously approved these changes Oct 25, 2022
@hazzik hazzik requested a review from bahusoid October 27, 2022 10:59
@hazzik hazzik enabled auto-merge (squash) October 27, 2022 20:00
@hazzik hazzik merged commit c6677a0 into nhibernate:master Oct 27, 2022
@fredericDelaporte fredericDelaporte deleted the GH3169 branch October 27, 2022 23:52
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.

InvalidOperationException: This transformer is not initialized by Cached Query
3 participants