[hibernate-dev] What does CacheConcurrencyStrategy.NONE mean?

Guillaume Smet guillaume.smet at gmail.com
Mon Jul 30 06:26:51 EDT 2018


Hi,

Does setting @Cache(usage = CacheConcurrencyStrategy.NONE) on an entity
mean that we entirely disable the 2nd level cache for this entity?

The documentation does not reference this value and the Javadoc does not
state clearly that the cache is disabled with this concurrency strategy.

Asking that because of:
- https://hibernate.atlassian.net/browse/HHH-12587 - where Chris disabled
writing to the cache in this case to fix a NPE;
- https://hibernate.atlassian.net/browse/HHH-12868 - where we have the
exact same NPE when reading from the cache.

The fix is easy if it's just about disabling the cache in this case but
maybe we should update the Javadoc of CacheConcurrencyStrategy if it's
about disabling the cache entirely?

Thanks for any insight!

-- 
Guillaume


More information about the hibernate-dev mailing list