How to disable hibernate caching

后端 未结 7 1156
梦谈多话
梦谈多话 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:44

    If you create a new (different) session within your unit test, it will "not" use the old one's cache. Or if you call clear() on it first (another option), etc.

提交回复
热议问题