| Another aspect to this is how we should handle this in regards to "second-level cache stats". At them moment the exposed method is: SecondLevelCacheStatistics getSecondLevelCacheStatistics(String regionName); and SecondLevelCacheStatistics is defined as exposing hit counts, miss counts, etc. From a user perspective is that really the granularity I am interested in? Or is a (regionName, category) tuple more what users are after[1]? Consider:
@Entity
@Cache(usage=..., region="a.b.c" )
class SomeEntity {
...
@OneToMany...
@Cache(usage=..., region="a.b.c" )
public Set<SomethingElse> someCollection;
}
The "usage" piece is irrelevant. The important piece is the region name. Going back to that stats API call...
sessionFactory.getStatistics().getSecondLevelCacheStatistics( "a.b.c" )...
Gets me the stats for both the entity data and the collection data combined. Is that reasonable? This partially gets into how we expect cache providers to map the notion of a region based on a name. Do we expect cache providers to map this based strictly on the regionName? Or based on the (regionName,category tuple[1]? [1] where category is an enum for ENTITY|NATURALID|COLLECTION|... |