Issue Type: Improvement Improvement
Affects Versions: 4.1.4
Assignee: Unassigned
Components: caching (L2)
Created: 09/Nov/12 1:50 PM
Description:

When working with Hibernate SessionFactory configured for multi-tenancy (Multi-tenant at application level and not schema level), the Query Cache and Entity Cache(s) that are managed by Hibernate are global for all tenants. There is no API to evict this data from these caches for a specific tenant. In Hibernate 4.1.6, the CacheKey exposes the tenantId (HHH-7502) so that we can at least write some custom code to iterate over all of the keys in the entity Cache and do some custom work. But this capability is not even available for QueryKey.

We have a business use case where there is a need to evict data from Entity and Query caches for a given tenant.

It would be helpful if tenantId is exposed on the QueryKey just like it is done for the CacheKey. If this supported, then we can at least write our own custom logic. In long term it would be nice to have API(s) for evictQueryRegion/evictEntityRegion/evictCollectionRegion for a specific tenant.

Environment: Hibernate 4.1.4, Ehcache 2.4.0
Project: Hibernate ORM
Labels: core hibernate cache
Priority: Major Major
Reporter: Kiran Kollipara
Original Estimate: 8h
Remaining Estimate: 8h
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira