Given the follow SQL structure:
and the following models:
Execute the following DQL 2 times:
The first time, you won't have any issues.
The second time, when the data will be fetched from the identityMap, you won't find it because there is something wrong with the identities and you will get the following warning
With the invalid key, it is not possible to get the entity from the identityMap.