EntityManager.find() throws EntityNotFoundException instead of returning null when entity is not found.
It happens in following scenario:
1. perform em.find(Entity.class, id)
2. DefaultLoadEventListener.returnNarrowedProxy() -> Entity proxy is found in session cache
3. DefaultLoadEventListener.doLoad() -> Entity is not resolved in any cache
4. It seems the entity is modified in DB in the meantime -> DefaultLoadEventListener.loadFromDatasource() returns null
5. therefore DefaultLoadEventListener.doLoad() returns null
6. DefaultLoadEventListener.load() returns null
7. DefaultLoadEventListener.returnNarrowedProxy() throws the exception
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira