title: How to disable hibernate caching
body: <p>I am trying to write a unit test class which will have to use same query to fetch the results from database two times in same test method. But as Hibernate cache is enabled second time it is not actually hitting the database and simply fetching the results from cache.</p>
  
  <p>Can someone please answer how to disable caching in <code>persistence.xml</code>.</p>
  
  <p>I tried to disable by changing properties  <code>hibernate.cache.use.query_cache = false</code>  and <code>hibernate.cache.use_second_level_cache = false</code>.</p>
  
  <p>But It did not work.</p>