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.
Can someone please answer how to disable caching in persistence.xml.
I tried to disable by changing properties hibernate.cache.use.query_cache = false and hibernate.cache.use_second_level_cache = false.
But It did not work.