Stale second level cache data with discriminator based multi tenancy

Setup:

  • discriminator-based multi tenancy
    • Most of the entities have@TenantId mapped field
    • A few entities are “global”, i.e. do not have tenant identifier field
  • use_second_level_cache: true

When one of the tenants modifies a “global” entity - the other tenants still see a previous version of the data until second level cache for that entity expires for the other tenants.

May I be missing something in my setup or do I need to somehow explicitly reset the cache for all tenants in such cases?

Please try to create a reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.