Although configuring org.hibernate.cache.LookupNaturalId cache region large enough and eternal, I always have Warning messages like following:
Debugging into hibernate, I detected that strangely at certain point in StatefulPersistenceContext.java
method RegionAccessStrategy#unlockRegion ist called, without ever calling lockRegion.
This unlockRegion call (in EHCache it clears the entire region!) has no sense here,
with evidency the removal of previousCacheKey item was intended here indeed.
Please see the pullrequest, it makes the warnings above dissappear.
EHCache as shared cache implementation, using read-write strategy