I've experienced the problem with the warning on immutable sets as well, so I cracked open the sourcecode for the version I'm using 3.1.2 and tracked down where the warning occurs.
It looks like in the class, the 'mutability' of all collections is hardcoded to true. I'm pasting a snippit from the source I was looking at for resource org.hibernate.impl.SessionFactoryImpl:
Code:
CacheConcurrencyStrategy cache = CacheFactory.createCache(
model.getCacheConcurrencyStrategy(),
model.getCacheRegionName(),
true,
settings,
properties
);
The third parameter in the above snippit is hardcoded to true, even though the provided model may have its mutable flag set to false. Within the createCache() method, if the mutability is set to true, and the concurrency strategy is read-only, you'll get the telltale warning MrSqueezles posted.
I'm not certain if this is a bug or an intended hardcoding, but was hoping someone with a bit more familiarity might be able to comment on this and let me know which is the case.
Thanks,
Josh Ladieu