How to disable hibernate caching

后端 未结 7 1092
梦谈多话
梦谈多话 2020-11-30 03:04

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

7条回答
  •  有刺的猬
    2020-11-30 03:57

    After the first time you query the result,call session.clear and then the same query will hit the database rather than level 1 cache

提交回复
热议问题