[hibernate-dev] API to clear/evict all caches in a session factory

Steve Ebersole steve at hibernate.org
Wed Feb 22 11:00:43 EST 2012


There is already:
sf.getCache().evictEntityRegions()
sf.getCache().evictCollectionRegions()
sf.getCache().evictDefaultQueryRegion()
sf.getCache().evictQueryRegions()

I can see a benefit to having evictQueryRegions() imply 
evictDefaultQueryRegion()

But, I fail to see a real benefit to a singular 
sf.getCache().oneEvictionToRuleThemAll()

On Wed 22 Feb 2012 09:49:35 AM CST, Galder Zamarreño wrote:
> Hi all,
>
> Re: http://java.dzone.com/tips/clearing-hibernate-second-leve
> Re: https://community.jboss.org/message/718710#718710
>
> Shouldn't Hibernate offer an API (independent of the cache provider) to clear all 2LC caches, including all entity, all collection and all query/timestamp caches?
>
> Beneath it, each cache provider would implement this as it wishes to do so, but the knowledge of all caches within a session factory is in Hibernate core itself.
>
> Cheers,
> --
> Galder Zamarreño
> Sr. Software Engineer
> Infinispan, JBoss Cache
>
>
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

-- 
steve at hibernate.org
http://hibernate.org



More information about the hibernate-dev mailing list