When using JQL-Update Queries it is basically not working without calling entityManager.clear() after a transaction commit. When the clear() method isn't called the entityManager will never return a container the updated Entities.
Scenario 1: Disabled L2 Cache, updating elements using UPDATE-Query and fetching Entities afterwards from database.
Expected result: Getting changed Entities from database - Actual result: No changes are visble.
Scenario 2: Disabled L2 Cache, updating elements using UPDATE-Query, calling entityManger.clear() and fetching Entities afterwards from database.
Expected result: Getting changed Entities from database - Actual result: Everything ok, but it is quite a mystery why ".clear()" has to be called.
Scenario 3: Enabled L2 Cache, updating elements using UPDATE-Query and fetching Entities afterwards from database.
Expected result: Getting changed Entities from database - Actual result: No changes are visble.
Scenario 4: Enabled L2 Cache, updating elements using UPDATE-Query, calling entityManger.clear() and fetching Entities afterwards from database.
Expected result: Getting changed Entities from database - Actual result: Only one Entity has been updated, the rest has its old value. And here it is the same - its not really comprehensible why a call of ".clear()" is required to get at least a little bit better (but obivously not correct) result.