Cache per RegionAccess IMO is just fine. From what I understand, this seems to make it easiest to use the most efficient cache keys that do not contain entity/collection names, right?
Well there is a trade off. Yes you can use more efficient keys always in this case, but you are also creating more caches. Which is more performant? Dunno, likely depends.
As Radim said, some functionality might not be fully possible with cache per region access, e.g. max entries for a entire region when this region is shared between different caches... Not being able to do this seems fine to me, not sure this is such a popular option.
I would rather not say that as a general Hibernate L2 cache limitation. But certainly with hibernate-infinispan we could chose to impose that limitation - I'd just want to see the failure up front, which the new contracts allow you to do. |