A cached NaturalKeyLookup query (immutable NaturalId) looking for a entity which has already been deleted,
This is different to the behavior with disabled 2L-Querycache where the query simply returns null.
Please see attached Testcase for details.
3.5.0-Beta3, HSQLDB, Ehcache as 2L-cache provider
The Bug is even worser than supposed:
NaturalKeyLookup query (Restrictions.naturalId() on immutable NaturalId )
continues to raise EntityNotFoundException even after a new entity with concerning
NaturalId was reinserted (and commited)!
This is definitely a BUG!
Please see attached Testcase TestLookupNaturalIdOnRecreatedEntity.jar
(find further needed resources TestLookupNaturalIdOnDeletedEntity.jar)
Workaround: evict manually the QueryCacheRegion each time after an entity with immutable NaturalId was deleted.
Bulk closing stale resolved issues