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

Steve Ebersole steve at hibernate.org
Mon Jul 30 09:59:44 EDT 2018


It is equivalent to `javax.persistence.Cacheable(false)`, although it was
never well defined what it means in relation to
`javax.persistence.SharedCacheMode`

On Mon, Jul 30, 2018 at 5:40 AM Guillaume Smet <guillaume.smet at gmail.com>
wrote:

> 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
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>


More information about the hibernate-dev mailing list