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

Array types are not working with query cache #669

Open
victornoel opened this issue Oct 25, 2023 · 2 comments
Open

Array types are not working with query cache #669

victornoel opened this issue Oct 25, 2023 · 2 comments
Labels

Comments

@victornoel
Copy link

Describe the bug

Because

  • array types require that values are specified using a java array
  • QueryKey used by hibernate's query cache simply wraps the values inside a Map
  • and most cache simply delegates to the Map's equals/hashCode

Then the query cache is not able to detect that two same queries with the same parameters involving some array type from this library are actually equal and so the cache is never exploited.

To Reproduce

Not sure how to reproduce it but I think the definition above is enough so that you can tell me if my understanding is correct.

If it is, with your guidance, I can try to make a PR to fix it :)

@vladmihalcea
Copy link
Owner

You can use this test case as a reference for the replicating test case.

After you create the test case, you can see whether the fix will make it pass.

@victornoel
Copy link
Author

FYI I have a fix ready, I need to polish a bit the tests and I will create a PR before end of next week :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants