| Query on field collection return null entities when having a cache hit. Example of query:
select m.employees from Manager m
In real world application, we are unable to babysit each query. Expert usually enable query cache on all queries and cache on all entities. Using example above, query cache on Manager works, and one day one of the many dozen developers add a query against a field collection. It works in the beginning because not used in a complex scenario so we don't have a second call occurring and so no cache hit. Then one day, in production with data changes, we got a cache hit, and the return value is a null entities and the application crash or the logic/data get corrupted. Two options here, and maybe the first option could be a short time solution while you are working the a long term solution: 1- Detect at runtime that the query is against a collection field an bypass any query cache hit. 2- Fix the logic so that query cache can work with collection field See attachment for a simple use case failing. |