| Steve Ebersole I think that configuration-based autodetection of shared/non-shared would not work 100%, given the numerous ways you can configure it, in embedded use or in WildFly... "Experimental" way = during initialization, putting key unique to given node into the cache and failing with explanatory message if such key is already there could work in many cases, though if the cache has eviction enabled and the caches are not started at the same moment, it could be already evicted... (regrettably it's not possible to mark entry as non-evictable). But given that if this detects the key already there, the cache really is shared, it could hint user. We would have to think about the key uniqueness a bit, too, since I can imagine users persisting the cache (incl. this key - though persistence can be avoided, it would not detect WFLY-6596 case if we just marked it as non-persistable). However if the app is just redeployed, so the 2LC is starting with a cache already containing the entities, we don't want to fail this check. To configure Hibernate correctly, I believe that setting `hibernate.cache.keys_factory` to `DefaultCacheKeysFactory` (eh, maybe with a better name given that it's non-default) should be sufficient (as long as that works). We could also introduce short-cut names because the `org.hibernate.cache.internal` should not be exposed when it's already "internal". |