2L-Querycache: NaturalKeyLookup throws EntityNotFoundException

Description

A cached NaturalKeyLookup query (immutable NaturalId) looking for a entity which has already been deleted,
throws EntityNotFoundException.
This is different to the behavior with disabled 2L-Querycache where the query simply returns null.
Please see attached Testcase for details.

Environment

3.5.0-Beta3, HSQLDB, Ehcache as 2L-cache provider

Activity

Show:
Guenther Demetz
February 12, 2010, 12:06 PM

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.

Steve Ebersole
March 21, 2011, 7:08 PM

Bulk closing stale resolved issues

Duplicate

Assignee

Gail Badner

Reporter

Guenther Demetz

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure