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

usage of any() pollutes query cache #1231

Closed
owahlen opened this issue Mar 3, 2015 · 2 comments
Closed

usage of any() pollutes query cache #1231

owahlen opened this issue Mar 3, 2015 · 2 comments
Milestone

Comments

@owahlen
Copy link

@owahlen owahlen commented Mar 3, 2015

We are using Spring Data together with query dsl 3.5.1.

We have several queries that make use of the any() expression.
When looking at the JPA query String that is created it shows an exists query with a table that contains a generated table name. More specifically the name seems to ends with some random alphanumeric characters.

Unfortunately each time querydsl generates the JPA query this name is different.
This in turn causes polution in the hibernate query cache.

Would it be possible to implement a naming strategy that produces reproducible names for the any()-tables?

@Shredder121
Copy link
Member

@Shredder121 Shredder121 commented Mar 3, 2015

I don't quite know how Spring Data resolves query objects, but we lazily initialize the any paths inside the collection paths, to reuse those instances.

However, I think it should be okay to think of a naming strategy, but we transform any usage to a join via parent. since this should be a temporary alias, it must not collide with other names.
@timowest what is your opinion?

@timowest
Copy link
Member

@timowest timowest commented Mar 4, 2015

We can change the logic to always produce the same aliases

@timowest timowest added this to the 4.0.0 milestone Mar 15, 2015
@timowest timowest changed the title usage of any() polutes query cache usage of any() pollutes query cache Mar 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.