usage of any() pollutes query cache #1231

owahlen opened this Issue Mar 3, 2015 · 2 comments


None yet

3 participants

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?


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 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 from usage of any() polutes query cache to usage of any() pollutes query cache Mar 20, 2015
@Shredder121 Shredder121 closed this in #1244 Mar 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment