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

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

Show comment
Hide comment
@Shredder121

Shredder121 Mar 3, 2015

Member

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?

Member

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Mar 4, 2015

Member

We can change the logic to always produce the same aliases

Member

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