Question: what is the difference between query cache and second level cache?
Answer: Difference: Query Cache's sole purpose is to cache the queries whereas Second Cache can be used to cache for other caches also. Query cache is provided by Hibernate internally whereas for Second level cache you have to choose some external second level cache such as Infinispan, EHCache etc.