Does anybody have any ideas what could be causing the following problem:
I have an entity, call it z, of entity class Z. It is involved in a cached query of the form 'from Z zz'. The query is executed and cached at a particular point in time, and a timestamp is attached to the metadata on the query result.
Then the entity z is then deleted in the normal flow of a usecase. The UpdateTimestampsCache records a last modified time of the table Z to be a few milliseconds before the timestamp in the query result cache. Thus, even though the entity is removed, the cached query still holds the pk of the entity in its list. When the cached query is executed, it obviously returns an error, since the entity no longer exists.
As far as I can see, the query cache is not managing its timestamps strictly.
However, the entity z itself was also cached directly, and it was removed correctly from the entity cache.
The environment is two application servers running versions 4.0.4.GA, with a clustered ejb3 container config.
Any ideas would be greatly appreciated.