|
Different JPQL queries might be mapped to the same QueryKey wich causes severe problems when using query caching as the cached result from another query might be returned.
Take for example these 2 JPQL query (with their parameters in [])
The org.hibernate.cache.spi.QueryKey for those 2 JPQL queries generated by org.hibernate.loader.QueryLoader.generateQueryKey(..) (implemented in the superclass org.hibernate.loader.Loader) both use the same SQL string and the same query parameters
SQL string:
Parameters:
Thus calling the first and the second JPQL query without any database modifications in between returns twice the result set for the first query whereas the result sets should differ (as they do when not using query caching)
|