| Bulk updates using queries or the criteria API can be used to avoid fetching an entity before executing the update. For example: UPDATE User u SET u.deleted = true WHERE u.id = :id In this case, the only modified entity is known, and the entity in question could be manually evicted from the second level cache. Instead, the whole cache region is evicted through a BulkOperationCleanupAction, and I have not been able to find a workaround for this. Currently it seems like it'd require modifying the EntityPersister itself, as this is where the affected regions are taken from. |