0

I have a schema-based multitenant application that uses Ehcache. Sometimes I need to evict the cache of a specific tenant/schema instead of whole application. Is there a way to achive this? Currently I use Cache#evictAllRegions and this is not what I want.

Ehcache Version: 3.9.9

Vishal Vasani
  • 647
  • 8
  • 16
kamer
  • 43
  • 1
  • 7

1 Answers1

1

That's not possible with Hibernate. Maybe your cache provide might have an option to implement something like that. The CacheKeyImplementation has a tenant identifier, so you might be able to remove all entries where the key object has a certain property value, but this is not something that the Hibernate integration provides out of the box.

Christian Beikov
  • 15,141
  • 2
  • 32
  • 58