如何使用Spring清除所有Hibernate缓存(ehcache)? [英] How to clear all Hibernate cache (ehcache) using Spring?
本文介绍了如何使用Spring清除所有Hibernate缓存(ehcache)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用二级缓存和查询缓存。
我可以知道如何以编程方式清除所有缓存?
I am using 2nd level cache and query cache. May I know how to programmatically clear all caches ?
推荐答案
要清除会话缓存,请使用 session.clear()
To clear the session cache use session.clear()
要清除二级缓存,请使用这段代码片段
To clear the 2nd level cache use this code snippet
这篇关于如何使用Spring清除所有Hibernate缓存(ehcache)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文